On 2/8/06, Amit Upadhyay <[EMAIL PROTECTED]> wrote: > > What I notice is that whenever an entry is added to LDAP, it is not > reflected in the SelectField drop-down on the create form for the model. But > if I simply restart the Apache httpd server, the drop-down is correctly > populated. > > > > Can someone tell me why this is so? > > This is so because getLocationChoices() is calculated when model is being > created. To solve your problem you can do the following:
You could do what Amit suggested, but I would suggest creating a separate Location model to avoid this problem entirely. The "choices" parameter is intended for a finite list of choices that never change. When you're dealing with data that needs to be dynamic, use the database. Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org