Re: [beginner] Commonly used variables.

2008-01-15 Thread Kenneth Gonsalves
On 16-Jan-08, at 3:26 AM, Petar wrote: > The thing is, in my sidebar I want to display all the categories. This > sidebar is the same for every view. How do I create the variables > needed for this recurring sidebar? So that in every view I can > generate a list of all categories in the database

Re: These waters aren't so friendly after all

2008-01-16 Thread Kenneth Gonsalves
On 17-Jan-08, at 9:42 AM, LRP wrote: > So where do I turn? Pylons? TurboGears? Ruby on Rails? anywhere but django please -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/ --~--~-~--~-

Re: These waters aren't so friendly after all

2008-01-17 Thread Kenneth Gonsalves
On 18-Jan-08, at 12:20 AM, LRP wrote: > I'm still having a problem since my shell can't seem to find django- > admin.py. I know it's there; found it in /usr/share/python-support/ > python-django/django/bin. this will not be on your path - and why debian packagers created that weird directory

best practices for a production site

2008-01-17 Thread Kenneth Gonsalves
hi, I have a site in production and being developed at the same time - a common django usecase I am sure. This is the first time I am developing a site with a team comprised of several remote contributors also. My previous teams were all in the same lab. Currently everyone with commit rig

Re: These waters aren't so friendly after all

2008-01-18 Thread Kenneth Gonsalves
On 18-Jan-08, at 4:57 PM, Forest Bond wrote: >>> Then there's Kenneth Gonzales. All I can say is, "hey dude, >>> that's not >>> very friendly." >> >> well, I was one of the people who told you *not* to rely on debian's >> apt-get for installing django - django is developing too fast for >> pac

Re: best practices for a production site

2008-01-18 Thread Kenneth Gonsalves
On 18-Jan-08, at 9:54 PM, William Siegrist wrote: > If the spelling changes are in 1 file, and the new feature is in > another file, can't you "svn update" just the spelling change file > and not the new feature file? And if they are in the same file, I > think the --revision option to svn

limit_choices_to in ModelForm

2008-01-19 Thread Kenneth Gonsalves
hi, I have a limit_choices_to in my model - but this does work on my ModelForm. How do I do this? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/ --~--~-~--~~~---~

Re: ImageField Example

2008-01-19 Thread Kenneth Gonsalves
On 19-Jan-08, at 6:02 PM, Darthmahon wrote: > Does anyone have a working example of uploading images using Django? > I've looked extensively and haven't found anything - any idea how I > save images using Django? I've put an ImageField in my model with the > path to where it should save, but how

Re: best practices for a production site

2008-01-20 Thread Kenneth Gonsalves
On 20-Jan-08, at 2:06 PM, Andrew wrote: > This also may be a good time to consider a distributed version control > system (Like bazaar or mercurial)... we're just about to finish > porting to bazaar after running up to several situations just like > yours. > > One benefit of DVCS is that branchi

Re: Django can't connect to postgresql

2008-01-20 Thread Kenneth Gonsalves
On 21-Jan-08, at 4:07 AM, LRP wrote: > Psycopg2.Operational Error: FATAL Ident authentication failed for user > 'webuser' # TYPE DATABASEUSERCIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all trus

Re: ImageFile not prepending MEDIA_ROOT onto upload_to folder location

2008-01-20 Thread Kenneth Gonsalves
On 21-Jan-08, at 11:37 AM, oak wrote: > (upload_to="/albums" upload_to="albums' - no '/' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/ --~--~-~--~~~---~--~---

Re: Django can't connect to postgresql

2008-01-21 Thread Kenneth Gonsalves
On 21-Jan-08, at 10:32 PM, LRP wrote: > Looks like I'll have study pg_hba.conf configuration in much more > detail. this is an unsafe default for you to get things working. Now experiment with using password or md5 or ident for authentication -- regards kg http://lawgon.livejournal.com htt

Re: separate template internationalization problem. where to put locale/ dir?

2008-01-22 Thread Kenneth Gonsalves
On 22-Jan-08, at 4:11 PM, sector119 wrote: > All my sources are in the /home/sector119/devel/eps_src/eps > All applications are in /home/sector119/devel/eps_src/eps/apps > And all my templates are in /home/sector119/devel/eps_src/templates > dir which contains app_name dir which contains templat

Re: How to apply a class to a specific field's label in newforms

2008-01-22 Thread Kenneth Gonsalves
On 22-Jan-08, at 5:45 PM, shabda wrote: > I want to have the one of the field for my form have a specific css > class. But if I do something like, > widget = forms.TextInput(attrs = {'size':60, 'class':'main'} > The textInput, and not its associated label gets the class. How can I > specify the

Re: How to apply a class to a specific field's label in newforms

2008-01-22 Thread Kenneth Gonsalves
On 22-Jan-08, at 6:35 PM, shabda wrote: > My template is > > {% for field in form %} > > {{ field.label_tag }} > {{field}} > {% if field.help_text > %}{{ field.help_text }}{% endif %} > {% if field.errors %} class="myerrors">{{ field.errors }}{% endif %}

Re: Django Redirect to login when writing to session

2008-01-23 Thread Kenneth Gonsalves
On 23-Jan-08, at 6:42 PM, Polar Bear z RPA wrote: > I try to write the form dict to a sesssion what code do you use to write the dict to the session? Probably you are overwriting the session dict instead of adding to it -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/

Re: Passing form initial values from one view to another?

2008-01-23 Thread Kenneth Gonsalves
On 24-Jan-08, at 8:49 AM, Dennis wrote: > Thanks again Jorge!! This newsgroup is really fantastic!, possibly - but is that an excuse for sending this mail 10 times? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registra

Re: Passing form initial values from one view to another?

2008-01-24 Thread Kenneth Gonsalves
On 24-Jan-08, at 10:59 PM, Dennis wrote: > Kenneth, that definitely wasn't my intention. I was just kidding - obviously you wouldn't have been so grateful as to send 10 thanks yous ;-) -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common

Re: best practice to construct 10x10 grid

2008-01-29 Thread Kenneth Gonsalves
On 29-Jan-08, at 4:18 PM, sircco wrote: > I have grid 10x10 populated with int>0. is the size fixed? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/ --~--~-~--~~~---

Re: problems with custom template library

2008-02-02 Thread Kenneth Gonsalves
On 03-Feb-08, at 8:06 AM, [EMAIL PROTECTED] wrote: > I have tried 'breaking' the filter module by entering all manner of > syntax errors in the file, deleting the import statements, leaving it > blank, etc. No matter what I do the error message is the same. this error message is hardcoded - it

Re: problems with custom template library

2008-02-02 Thread Kenneth Gonsalves
On 03-Feb-08, at 8:06 AM, [EMAIL PROTECTED] wrote: > @register.filter() try: @register.filter <--- without the '()' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/ --~--~-~--~

Re: What is best way of positioning html edit boxes?

2008-02-02 Thread Kenneth Gonsalves
On 03-Feb-08, at 11:24 AM, Glenn_NZ wrote: > I am a new django user and I am using the django trunk version. > Inside the template I am using the {{form.as_p}} template variable to > automatically output all the fields for the form. > > Someone told me, not from this group, that the best way of

Re: What is best way of positioning html edit boxes?

2008-02-03 Thread Kenneth Gonsalves
On 03-Feb-08, at 1:02 PM, Glenn_NZ wrote: > I am not modifying form.as_p() in the view. Should I be? you shouldnt be. If you want fine-grained control over the positioning of parts of the form, you have to break the form up in the template and manually position the elements. Like what is d

Re: django version for production?

2008-02-05 Thread Kenneth Gonsalves
On 05-Feb-08, at 5:27 PM, Aljosa Mohorovic wrote: > please post your opinions on using 0.96 or trunk version in production > environment. > which would you choose and why? trunk - because it has a lot of goodies that .96 doesnt have - 96 is really old -- regards kg http://lawgon.livejourna

Re: django version for production?

2008-02-05 Thread Kenneth Gonsalves
On 05-Feb-08, at 6:58 PM, Pigletto wrote: >> please post your opinions on using 0.96 or trunk version in >> production >> environment. >> which would you choose and why? > I'm using svn version from newforms-admin branch with some additional > patches. > As Kenneth already said, svn version ha

Re: django version for production?

2008-02-05 Thread Kenneth Gonsalves
On 05-Feb-08, at 7:15 PM, Jarek Zgoda wrote: > some day it would not be feasible to port any application to "1.0". I > know personally many people still having their apps running on 0.91 > because of too large amount of work needed to port to any later > version. I have 5 old sites running on

Re: django version for production?

2008-02-06 Thread Kenneth Gonsalves
On 06-Feb-08, at 2:08 PM, Jarek Zgoda wrote: >> you do have a development environment, right? ;) > > I remember one issue just after autoescaping went into trunk, that was > visible only on sites runnung on FastCGI, so development server/env > sometimes clearly is not enough to catch everything.

Re: Opinion requested on issue related to model inheritance and exceptions

2008-02-06 Thread Kenneth Gonsalves
On 06-Feb-08, at 3:07 PM, Safariman wrote: > I'd like some opinions about something. I'd like to know if this is > correct behavior or if it could be considered a bug in django. > > This issue is related to 2 models where one model is the superclass of > the other. Let me illustrate with an smal

Re: [newbie]Apache Deployment Problem

2008-02-06 Thread Kenneth Gonsalves
On 06-Feb-08, at 7:41 PM, Tony Winslow wrote: > I installed mod_python and do the configurations as the tutorial on > the > official site. But mod_python still can not find the mysite.settings > module. What might be the problem? paste the relevant part of your apache config -- regards kg

Re: Best way to template "," and "and" separated lists?

2008-02-06 Thread Kenneth Gonsalves
On 07-Feb-08, at 10:45 AM, toomim wrote: > What is the best way of implementing this in a django template? Right > now I'm using a {% for %} loop, where each iteration prints a "," or > "and" or nothing depending on the iteration of the loop, using a bunch > of {% if %} statements to branch on t

Re: How popular is Django ?

2008-02-12 Thread Kenneth Gonsalves
On 12-Feb-08, at 6:22 PM, Hanne Moa wrote: >> http://www.therightsoft.com/softwaretechnologies/webframeworks > > Where's Drupal on this list? Drupal is not a web framework - it is a CMS. -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common

Re: How popular is Django ?

2008-02-12 Thread Kenneth Gonsalves
On 12-Feb-08, at 4:30 PM, tom wrote: > How popular is Django among other Python Web Frameworks (TurboGears, > Pylons, Webware, CherryPy...) ? one statistic - read what you want into it. members in IRC: August 2005: Django 45, TG 45, ROR 400 February2008: django 339 and growing, TG 52, ROR 278

Re: When ForeignKey fields are left blank, objects don't appear in admin change list. Why?

2008-02-24 Thread Kenneth Gonsalves
On 25-Feb-08, at 8:00 AM, biancaneve wrote: > ForeignKey field to blank=True, have you tried setting null=True also? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/ --~--~-~--~~

Re: Where to send localized files

2008-03-07 Thread Kenneth Gonsalves
On 07-Mar-08, at 11:52 PM, Boris Ozegovic wrote: > I did localization for croatian language. Where do I send .po files? create a ticket - attach the files - announce on the i18n list -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common ma

Re: App not showing up in Admin Site

2008-03-09 Thread Kenneth Gonsalves
On 09-Mar-08, at 12:03 PM, Lukey wrote: > tutorial, but im using 0.96.1... then use the docs for .96 - but it is far better to use the svn trunk as there are a lot of goodies there that .96 doesnt have. Also when you do upgrade you will face a lot of backward compatible problems -- regar

Re: How to custom the language of error text of newform

2008-03-25 Thread Kenneth Gonsalves
On 25-Mar-08, at 12:30 PM, PENPEN wrote: > But by default the error text from Django is in English. Then if I > want to display Chinese messages, what should I do? Does Django have > some shortcuts to support such case? Many thanks! http://www.djangoproject.com/documentation/i18n/ -- regar

Re: Forms not same fields than Models

2008-03-26 Thread Kenneth Gonsalves
On 26-Mar-08, at 6:44 PM, didier rano wrote: > I need to have a Form (newforms) with different fields than my > Model. In fact, one form instance will generate several models > instances. Haves you seen it before ? How create and update it ? http://www.djangosnippets.org/snippets/463/ --

Re: Problem with nested loop

2008-03-28 Thread Kenneth Gonsalves
On 29-Mar-08, at 9:43 AM, Brandon Taylor wrote: > def showCategories(request): > categories = Category.objects.all().select_related() > return render_to_response('showCategories.html',{'categories': > categories}) > > > In my template, I have: > > {% for category in categories %} > {

Re: Problem with nested loop

2008-03-28 Thread Kenneth Gonsalves
On 29-Mar-08, at 10:13 AM, Brandon Taylor wrote: > Sorry, that's my fault. I was trying to simplify the naming a bit for > the post. 'work_category' should just be 'category' could you paste the relevant models also (preferably without 'simplifying') -- regards kg http://lawgon.livejournal

Re: Problem with nested loop

2008-03-28 Thread Kenneth Gonsalves
On 29-Mar-08, at 10:30 AM, Brandon Taylor wrote: > Sure. This app is for my portfolio. Here's my models.py > > class WorkCategory(models.Model): > title = models.CharField(max_length = 30) > position = models.PositiveSmallIntegerField() > > def __unicode__(self): >

Re: Problem with nested loop

2008-03-28 Thread Kenneth Gonsalves
On 29-Mar-08, at 10:52 AM, Brandon Taylor wrote: > So, to simplify my question, how can I access the child objects of a > 'work_category' through the nested for loop, given my model structure? each WorkSample will have one work_category which you can access like this: worksamples = WorkSampl

Re: Problem with nested loop

2008-03-28 Thread Kenneth Gonsalves
On 29-Mar-08, at 11:17 AM, Brandon Taylor wrote: > What I would like to accomplish is output that looks as such: > > Category name > > Sample Name > Sample Name > Sample Name > > > Category name > > Sample Name > Sample Name > Sample Name > > wc = WorkCategory.objects.all() for w

Re: Problem with nested loop

2008-03-28 Thread Kenneth Gonsalves
On 29-Mar-08, at 11:43 AM, Kenneth Gonsalves wrote: > {% for w in wc %} w.title<-- forgot this > > {% for sample in w.workcategory_set.all %} > sample > {% endfor %} > > {% endfor %} -- regards kg http://lawgon.livejournal.com http:/

Re: Problem with django unit testing

2008-03-30 Thread Kenneth Gonsalves
On 30-Mar-08, at 1:31 PM, [EMAIL PROTECTED] wrote: > Any one who can help me? Thank you so much! be patient - it is a weekend ;-) -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this message be

Re: mark_safe for a html field

2008-03-30 Thread Kenneth Gonsalves
On 31-Mar-08, at 7:20 AM, Marc Garcia wrote: > does anybody know a simple way to mark a model field as safe html (and > tell django not to escape this field content)? http://www.djangoproject.com/documentation/templates/#automatic-html- escaping -- regards kg http://lawgon.livejournal.com h

Re: Using Django for Teaching

2008-03-30 Thread Kenneth Gonsalves
On 31-Mar-08, at 9:58 AM, Todd O'Bryan wrote: > Sorry this is two weeks late (it's been a bear of a two weeks), but > I use Django with high school students who've done the equivalent > of a year of college programming--the AP Computer Science AB > curriculum. what age would these student

Re: 'module' object has no attribute 'day_abbr' --Problem editing using Admin

2008-03-30 Thread Kenneth Gonsalves
On 31-Mar-08, at 10:28 AM, Ryan Vanasse wrote: > class Event(models.Model): > eventName = models.CharField(maxlength=63) > #eventDate = models.DateField() > start_time = models.DateTimeField() > end_time = models.DateTimeField() > eventLocation = models.CharField(ma

Re: Custom ID field with random string

2008-03-31 Thread Kenneth Gonsalves
On 31-Mar-08, at 2:30 PM, Julien wrote: > I just thought I'd try to make it clearer what I'm after. Instead of > having numbers as ID for my objects, I'd like to have random strings > (e.g. "sadfwetbtyvt32452" or "fd70982876adhfd"...). Those strings have > to be unique across the table. > Is tha

Re: Error adding an excluded field

2008-04-01 Thread Kenneth Gonsalves
On 02-Apr-08, at 7:59 AM, [EMAIL PROTECTED] wrote: > def cartuchoFallado(request, numinfo): > if request.method == 'POST': > data = copy(request.POST) > data['informe'] = numinfo > form = forms.CartuchoFalladoFrm(data) > if form.is_valid(): > form

Re: unique=True doesn't seem to do its job

2008-04-01 Thread Kenneth Gonsalves
On 02-Apr-08, at 12:03 PM, Julien wrote: > get() returned more than one Project -- it returned 2! Lookup > parameters were {'slug__exact': u'hello'} > > I have the same issue on the front end using ModelForm. > > Shouldn't that raise an IntegrityError, and then reload the form page > with an err

Re: how do I create a zebra table using a template?

2008-04-11 Thread Kenneth Gonsalves
On 11-Apr-08, at 9:36 PM, Kenneth Gonsalves wrote: > On 11-Apr-08, at 9:28 PM, Chas. Owens wrote: > >> {% if forloop.counter % 2 %} > > divisibleby http://www.djangoproject.com/documentation/templates/#divisibleby -- regards kg http://lawgon.livejournal.com http://nrcfo

Re: how do I create a zebra table using a template?

2008-04-11 Thread Kenneth Gonsalves
On 11-Apr-08, at 9:28 PM, Chas. Owens wrote: > {% if forloop.counter % 2 %} divisibleby -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: how do I create a zebra table using a template?

2008-04-11 Thread Kenneth Gonsalves
On 11-Apr-08, at 9:42 PM, Jeff Gentry wrote: > On Fri, 11 Apr 2008, Kenneth Gonsalves wrote: >>> {% if forloop.counter % 2 %} >> divisibleby > > Actually, he should be using 'cycle' my reply was simply to let him know that there are such things

Re: Allowing html tags for filter.

2008-04-11 Thread Kenneth Gonsalves
On 11-Apr-08, at 10:05 PM, Dmitriy Sodrianov wrote: > I have a custom filter that outputs some html code. The problem is > that it converts all "greater than" and "less than" symbols to > appropriate > and < symbols. How is it possible to say to > filter not to do this? unless we see the code

Re: Templates won't translate

2008-04-12 Thread Kenneth Gonsalves
On 12-Apr-08, at 10:15 PM, Basti wrote: > Probably I'm only being stupid but I can't get my templates to be > translated. Everything else (translation in views etc.) works fine. does the template stuff appear in django.po? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in

Re: Django Tutorial Site not in Admin

2008-04-13 Thread Kenneth Gonsalves
On 13-Apr-08, at 3:54 PM, garazy wrote: > It does not appear in the admin when I login with the superuser > account that got created when I installed the project. Please let me > know what other information you need me to provide to debug this large > problem. please post your models.py file -

Re: Help with getting drop-downs to work

2008-04-13 Thread Kenneth Gonsalves
On 14-Apr-08, at 8:25 AM, Karen Tracey wrote: > I just tried that command and it works for me. Are you behind a > corporate firewall? I've seen reports that they sometimes > interfere with svn traffic, depending on how they are configured. > The usual workaround is to use https:// inste

Re: How to use dojo toolkit in django?

2008-04-14 Thread Kenneth Gonsalves
On 14-Apr-08, at 12:43 PM, Duke wrote: > How to use dojo toolkit in django project? > Where to store the dojo toolkit in the project and how to use them in > the html page? http://www.djangoproject.com/documentation/serialization/ -- regards kg http://lawgon.livejournal.com http://nrcfosshel

Re: How to use dojo toolkit in django?

2008-04-14 Thread Kenneth Gonsalves
On 14-Apr-08, at 2:02 PM, Kenneth Gonsalves wrote: >> How to use dojo toolkit in django project? >> Where to store the dojo toolkit in the project and how to use them in >> the html page? > > http://www.djangoproject.com/documentation/serialization/ sorry - that is for

Re: Looping....

2008-04-15 Thread Kenneth Gonsalves
On 15-Apr-08, at 4:06 PM, Duke wrote: > How to use Loop counter iteration (ie) looping 10 time in Django > Template language (html) use 'for' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received thi

Re: Looping....

2008-04-15 Thread Kenneth Gonsalves
On 15-Apr-08, at 4:23 PM, Duke wrote: > Can u give some example since for iteration over a array or a > dictionary http://www.djangoproject.com/documentation/templates/#for -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~-

Re: Looping....

2008-04-15 Thread Kenneth Gonsalves
On 15-Apr-08, at 9:04 PM, Darryl Ross wrote: > Duke wrote: >> They are looping over a list >> I am looking for >> for (i = 0; i < 10; i++) { >> printf("Hello, World!); >> } >> link for looping statement > > > I am not aware of any tag that will allow you to do that, out of > the box. You

Re: Something wrong with dividing

2008-04-16 Thread Kenneth Gonsalves
On 17-Apr-08, at 10:57 AM, Poz wrote: > I've got a small problem. I am a newbie and I can't figure out what is > wrong with the script below. > > I'm trying to count up the "likes" and divid them by the > "likes"+"dislikes", but all I get when I divided them is > 0.0 >>> a = 1 >>>

Re: Django en Dreahost

2008-04-17 Thread Kenneth Gonsalves
On 18-Apr-08, at 5:01 AM, Juanjo Conti wrote: >>2. Download, Compile and install Python 2.5. DH default is 2.3 and >>2.4. > > Why this? Does not Django run with Python <= 2.3? afaik no -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~

BooleanField in newforms returns 'on' and not True

2008-04-18 Thread Kenneth Gonsalves
hi according to the docs a BooleanField in newforms: "Normalizes to: A Python True or False value." but in svn version 7387 I am getting a value of u'on'. Is this a bug in the documentation or am I misreading the docs? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/co

Re: how do designers create content

2008-04-19 Thread Kenneth Gonsalves
On 20-Apr-08, at 12:03 PM, lee wrote: > Do the designers use text base editting like ultraedit or > or graphics based software like dreamweaver? Most of the artist I know > don't do much coding and are into photoshop, illustrator and > dreamweaver. On sites like lawrence.com where there are lot

Re: how do designers create content

2008-04-19 Thread Kenneth Gonsalves
On 20-Apr-08, at 12:16 PM, James Bennett wrote: > On Sun, Apr 20, 2008 at 1:33 AM, lee <[EMAIL PROTECTED]> wrote: >> designers. Do the designers use text base editting like ultraedit or >> or graphics based software like dreamweaver? Most of the artist I >> know >> don't do much coding and

Re: 'message_set' causes ProgrammingError while handling Exception

2008-04-20 Thread Kenneth Gonsalves
On 21-Apr-08, at 12:50 AM, radioflyer wrote: > > Hello, > I need some help with the code after the IntegrityError exception. > > > s = Student.objects.get(pk=student_id) > > if request.method == 'POST': > form = ChangeForm(request.POST) > if form.is_valid(): > try: > form.save

Re: Layout Questions

2008-04-20 Thread Kenneth Gonsalves
On 21-Apr-08, at 3:05 AM, Greg Lindstrom wrote: > I'll be happy to post some code, but I'd like some direction on how > to set up a page. I would like a header and sidebar. The footer > is optional, but I think it gives a nice, finished look to the page > (and it's where I have the "Powe

Re: 'message_set' causes ProgrammingError while handling Exception

2008-04-20 Thread Kenneth Gonsalves
On 21-Apr-08, at 6:42 AM, radioflyer wrote: > I've decided to manually check for uniqueness after form validation > and before saving, and that seems to work fine for now. > > Things like 'unique_for_date' and 'unique_together' seem to work great > in the admin interface, but in the wild, you ha

Re: A modeling/implementation quiz

2008-04-21 Thread Kenneth Gonsalves
On 21-Apr-08, at 8:15 PM, Michael wrote: > What about using the count() method on a filtered subset to get your > id? > > Eg: > p = People(type="S") > p.id = People.objects.filter(type=p.type).count() + 1 I dont know what the context of this is, but this would only give the id if you have

Re: Weblog archive links are bad

2008-04-21 Thread Kenneth Gonsalves
On 22-Apr-08, at 2:44 AM, Jon Lesser wrote: > I tried to open a trac ticket on this, but it thinks I'm a spammer. fill in your profile or register at the site and it will accept you -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~--

Re: Question about urls.py

2008-04-21 Thread Kenneth Gonsalves
On 22-Apr-08, at 4:00 AM, jmDesktop wrote: > (r'^contact/thanks/(.)/$','mysite.books.views.thanks' (r'^contact/thanks/(?P.)/$','mysite.books.views.thanks'), will direct to the thanks function which you call as: def thanks(request,sender) and this thanks function loads the thanks template with

Re: File upload with no database - Fantasy or reality?

2008-04-22 Thread Kenneth Gonsalves
On 22-Apr-08, at 12:42 PM, python_fan wrote: > So, my question is: Is it possible to add file upload functionality > (upload file from client to server -> save it on server somewhere -> > pass the path to python code on the server) without any underlying > databases? yes - just get the filename

Re: File upload with no database - Fantasy or reality?

2008-04-22 Thread Kenneth Gonsalves
On 22-Apr-08, at 12:54 PM, Kenneth Gonsalves wrote: >> So, my question is: Is it possible to add file upload functionality >> (upload file from client to server -> save it on server somewhere -> >> pass the path to python code on the server) without any underlying >

Re: File upload with no database - Fantasy or reality?

2008-04-22 Thread Kenneth Gonsalves
On 22-Apr-08, at 1:00 PM, python_fan wrote: >>> yes - just get the filename and content from request.POST and >>> save it >>> wherever you like using ordinary python >> >> oops - from request.FILES >> > > Great! Thanks! > > Can I see a working example? I tried various things, and it almost > w

Re: File upload with no database - Fantasy or reality?

2008-04-22 Thread Kenneth Gonsalves
On 22-Apr-08, at 1:23 PM, python_fan wrote: >>> Can I see a working example? I tried various things, and it almost >>> worked (I got a widget on the page, got an upload button, etc), but >>> nothing happens when i press Upload/Submit. >> >> paste your view and template please > > I guess the pro

Re: how do designers create content

2008-04-22 Thread Kenneth Gonsalves
On 22-Apr-08, at 7:31 PM, lee wrote: > In the django world of template coding would the artist be the one who > added content to this layout or the programmer? > Would he use a text editor to add the django template code for dynamic > content or something like dreamweaver? a lot depends on the

Re: form.as_table not displaying in template

2008-04-22 Thread Kenneth Gonsalves
On 22-Apr-08, at 9:32 PM, Explore wrote: > test 1 > > {{ form.as_table }} > > > nothing prints out (maybe because it is trying to print the object > instead of calling the method?) this is correct. It should work, but to diagnose you should post the full template and the full view

Re: how do designers create content

2008-04-22 Thread Kenneth Gonsalves
On 23-Apr-08, at 5:02 AM, Jorge Vargas wrote: > developer (me) starts working on the site outputting plain simple > html, h1,h2, div,etc and forms. not worrying about the master. > designer starts working on the master either photoshop or whatever. > then I sit down with the designer and start t

Re: Iterating through inner dictionaries

2008-04-22 Thread Kenneth Gonsalves
On 23-Apr-08, at 8:11 AM, jwwest wrote: > I have a view that returns a dictionary containing several > dictionaries. What's the proper way to iterate through each sub > dictionary in a template? I tried a nested for, but I'm getting a > template error saying that my top most dictionary is a long

Re: Auto fill the form field???

2008-04-23 Thread Kenneth Gonsalves
On 23-Apr-08, at 1:12 PM, laspal wrote: > So my question is does django gives any tool for this or do I have to > write java script for it..??? you will have to write javascript for it -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~---

filtering in ModelChoices not working

2008-04-23 Thread Kenneth Gonsalves
hi, this is my code snippet: class Ingredientrecform(forms.ModelForm): """ Form to add Ingredients. """ def __init__(self,pageid, *args, **kwargs): super(Ingredientrecform, self).__init__(*args, **kwargs) self.pageid = pageid ingredient

Re: Largest django sites?

2008-04-23 Thread Kenneth Gonsalves
On 23-Apr-08, at 3:34 PM, bcurtu wrote: > But, turning back to my question... Can you tell these sites with > thousands or hundreds of thousands hits per minute? Ok, let's leave > apart their stats... Any big name on the internet? slashdot? twitter > is RoR... you could take a look at the djang

Re: filtering in ModelChoices not working

2008-04-23 Thread Kenneth Gonsalves
replying to myself On 23-Apr-08, at 2:28 PM, Kenneth Gonsalves wrote: > class Ingredientrecform(forms.ModelForm): > """ > Form to add Ingredients. > """ > def __init__(self,pageid, *args, **kwargs): > super(I

Re: exclude with ForeignKey

2008-04-23 Thread Kenneth Gonsalves
On 24-Apr-08, at 11:47 AM, Kevin L wrote: > Hello Django users, I'm having trouble with an exclude statement and > was hoping some kind soul could help me out. My models are simple, > it's basically just two models with a ForeignKey relationship. > > class Parent(models.Model): > pass > class

Re: exclude with ForeignKey

2008-04-24 Thread Kenneth Gonsalves
On 24-Apr-08, at 12:48 PM, Kevin L wrote: > Thanks everyone for the responses, I'm very impressed by the quick > response of the community here ;-) if you want extra-fast responses come to #django on freenode -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~

problem with i18n in admin interface

2008-04-25 Thread Kenneth Gonsalves
hi, am using revision 7457. I just noticed that in the admin interface, the following are not being translated: add select to change for example on the main index: in english: 'areas' in finnish: 'Alueet' no problem but in the add screen: in english: Add area in finnish: Uusi area (the word 'ar

Re: is_valid() name change?

2008-04-25 Thread Kenneth Gonsalves
On 25-Apr-08, at 3:58 PM, Thomas Guettler wrote: >> ticket. It's always taken into account that there is often more >> than one >> person wishing for any particular feature or bug fix. >> >> > How can you know how many people have this problem, if nobody says > "me too", > or "patch works fo

Re: File upload with no database - Fantasy or reality?

2008-04-25 Thread Kenneth Gonsalves
On 25-Apr-08, at 11:22 PM, python_fan wrote: > Hm... seems like I'm still missing something. All I get on the web > page is 'None'. Any ideas? do you have enctype="multipart/form-data" in your form? -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~

Re: File upload with no database - Fantasy or reality?

2008-04-25 Thread Kenneth Gonsalves
On 26-Apr-08, at 7:08 AM, Kenneth Gonsalves wrote: >> Hm... seems like I'm still missing something. All I get on the web >> page is 'None'. Any ideas? > > do you have enctype="multipart/form-data" in your form? or better still, please paste your full

Re: Genealogy apps

2008-04-28 Thread Kenneth Gonsalves
On 28-Apr-08, at 11:02 PM, ecrosstexas wrote: > Does anyone know of any existing apps writtrn in Django for > genealogy? I thought there was one in Google Code awhile back, but I > can't seem to find it now. is the year 1900 problem solved? if not , genealogy would be a little difficult --

Re: unable to open database file

2008-04-28 Thread Kenneth Gonsalves
On 29-Apr-08, at 1:52 AM, [EMAIL PROTECTED] wrote: > I get a operational error when i try to access the sqlite3 database > file. This doesn't happen with Django built in server only with > apache. The file has 660 permission so i dont know why it cant be > opened everything else works fine

Re: web hosting

2008-04-30 Thread Kenneth Gonsalves
On 30-Apr-08, at 3:09 PM, sharongolfer wrote: > I am not a tech head and so excuse my basic language. My web site has > been redesigned using Python and Django. My current hosting company > supports Python but not Django, does this matter? If it does can > anyone recommend a host. The designer

Re: Filefield upload_tol

2008-05-05 Thread Kenneth Gonsalves
On 05-May-08, at 5:33 PM, Ben Eliott wrote: > Hi, I'm getting started in the (highly enjoyable!) admin models - > FileField upload works when I give upload_to the full absolute > filepath. > However, as soon as I try and use MEDIA_ROOT in settings.py it baulks. what do you mean by 'baulks' -

Re: Filefield upload_tol

2008-05-05 Thread Kenneth Gonsalves
On 05-May-08, at 6:46 PM, Ben Eliott wrote: > Thanks for for your swift attention. > It reloads the same form with the message at the top: 'Please correct > the error below.' (although it doesn't actually show any error below). please paste your model here -- regards kg http://lawgon.livejou

Re: Filefield upload_tol

2008-05-05 Thread Kenneth Gonsalves
On 05-May-08, at 7:22 PM, Ben Eliott wrote: > hip = models.FileField(upload_to='/tmp',core=True) try upload_to='tmp' <--- no '/' -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~~~---~--~~ You received this

Re: What Django version should I use?

2008-05-05 Thread Kenneth Gonsalves
On 05-May-08, at 9:48 PM, Daniel Strasser wrote: > Is it recommended to use the development version for a project that > starts now (or in a week ;-)) yes - unless you want to miss out on a lot of goodies and are masochist enough to enjoy upgrading your project through a bunch of backward i

Re: New to django and python. error following tutorial w/ the shell

2008-05-05 Thread Kenneth Gonsalves
On 06-May-08, at 9:37 AM, Jason Ourscene wrote: > def __unicode__(self): def __unicode__(self): <- space after 'def'. If you use a python editor it will find errors like this -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/code/ --~--~-~--~

Re: New to django and python. error following tutorial w/ the shell

2008-05-05 Thread Kenneth Gonsalves
On 06-May-08, at 10:02 AM, Norman wrote: > Kenneth Gonsalves escribió: >> >> On 06-May-08, at 9:37 AM, Jason Ourscene wrote: >> >>> def __unicode__(self): >> >> def __unicode__(self): <- space after 'def'. If you use a >&

<    3   4   5   6   7   8   9   10   11   12   >