Re: function to generate choices list
Aidas, On 8 Jul 2007, at 3:51 pm, Aidas Bendoraitis wrote: I think, the problem would be solved if you assigned a class overriding list instead of a preformed list to the choices. Check XFieldList for a living example: http://www.djangosnippets.org/snippets/51/ Thanks for your suggestion. This, again wouldn't work on our production server, I think because it is running Python 2.3 still (but there could be some other reason). Just for completeness, the fix I used in the end was to make a custom field which rendered with a list of folders from the filesystem. Thanks, David -- David Reynolds [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature
Re: function to generate choices list
I think, the problem would be solved if you assigned a class overriding list instead of a preformed list to the choices. Check XFieldList for a living example: http://www.djangosnippets.org/snippets/51/ Regards, Aidas Bendoraitis aka Archatas On 7/6/07, David Reynolds <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to pre-populate a choices list for a CharField from some > folders on the file system, I was doing this by calling a function > within the models.py which assigned the list of folders to a variable > which was then used in the charfield. This all worked perfectly using > the development server, however, when deploying the site under > apache2/mod_python I find that this list only ever gets updated when > apache is restarted. I had vaguely thought of using a signal((pre| > post)-init) to create the list as a global variable, but that didn't > seem to work. > > Does anyone, please have any idea how I could do this? > > Thanks, > > Dave > > -- > David Reynolds > [EMAIL PROTECTED] > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com 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 -~--~~~~--~~--~--~---
function to generate choices list
Hi, I'm trying to pre-populate a choices list for a CharField from some folders on the file system, I was doing this by calling a function within the models.py which assigned the list of folders to a variable which was then used in the charfield. This all worked perfectly using the development server, however, when deploying the site under apache2/mod_python I find that this list only ever gets updated when apache is restarted. I had vaguely thought of using a signal((pre| post)-init) to create the list as a global variable, but that didn't seem to work. Does anyone, please have any idea how I could do this? Thanks, Dave -- David Reynolds [EMAIL PROTECTED] smime.p7s Description: S/MIME cryptographic signature