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
class aModel(models.Model):
         myfield = models.CharField()

## 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 computed in
another python file.

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' chain or something like that.

As anyone an idea how I can fix this problem because I can't allow
users to 'touch' the python files

Thanks

./ed

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to