Re: problem with forms with db access

2008-06-15 Thread ./ed
Hi actually i did not go as smoothly as i expected :( first ModelChoiceField is *really* implemented only on development version (i was on the lastest release) so i had to clean a lot of code plus to obtain the first item on the list of choices (and not the empty string) you need to set the the

Re: problem with forms with db access

2008-06-15 Thread ./ed
Thanks a lot! i had the feeling it was a class/instance issue it should work fine now Thx again ./ed On Jun 15, 4:53 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sun, Jun 15, 2008 at 7:58 AM, ./ed <[EMAIL PROTECTED]> wrote: > > the problem is that when i add an entry to the aModel

Re: problem with forms with db access

2008-06-15 Thread James Bennett
On Sun, Jun 15, 2008 at 7:58 AM, ./ed <[EMAIL PROTECTED]> wrote: > the problem is that when i add an entry to the aModel table it does > not update in the form (even with various reload scheme) > it does update when I 'touch' the python file. So my guess is the > problem lies in the 'compilation'

Re: problem with forms with db access

2008-06-15 Thread Daniel Roseman
On Jun 15, 1:58 pm, "./ed" <[EMAIL PROTECTED]> wrote: > ## forms.py > class aForm(forms.Form): > choicelist = [(obj.id,obj.myfield) for obj in > aModel.objects.all()] > mod = forms.ChoiceField(choice=choicelist) > > that's not exactly the code because the choice list is

problem with forms with db access

2008-06-15 Thread ./ed
Hi, I'm an experienced programmer in python but I discovered Django last week and managed to deploy a full application in one day! That's a piece of work. I have a slight problem though. I want to have a form with a choice list where items come from the database. For example : ## models.py