Malcolm Tredinnick napisaƂ(a):

>> In my app I have one pretty generic model that handles few (not so
>> different) types of content. One of the things that make these types
>> different is choice of possible states. I'd like to keep the choices
>> as choices, not as separate model. Currently I have moved the choices
>> out of my models.py file and import them dynamically into module's
>> scope depending on the "mode" application is actually running but it
>> seems a hackish by nature, I'd like to have them imported/injected
>> (into module or model class scope) in more elegant way. Is this
>> possible at all?
>>
>> I was looking at class_prepared signal, but it's fired too late...
> 
> The "choices" attribute can be a callable. So you can determine the
> choices in a function if you like. This might be of interest:
> http://www.pointy-stick.com/blog/2007/03/26/django-tips-variable-choice-lists/

Thanks, I'll try this approach.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to