You could define the CHOICES as a member of your model class, like so: class Movie( Relic ): CHOICES=((u'1','one'), (u'2',u'two')) disk_type = models.CharField( 'Type', max_length=8, choices=CHOICES)
Then, in your form: class MovieForm( BasicRelicForm ): disk_type = forms.CharField( widget = choicewidget ( choices=Movie.CHOICES )) class Meta: model = Movie That seems, to me, to be the cleanest way to do it. You can also access the choices like this, but I wouldn't recommend it: choices = Movie._meta.get_field('disk_type').choices -Jeff On Nov 21, 4:09 am, Donn <[EMAIL PROTECTED]> wrote: > On Friday, 21 November 2008 08:06:32 urukay wrote: > > > easy way how to solve it is to put definition of your choices out of model > > definition: > > Yeah, that's what I call a 'global', but is there no way to get the choices > from the field in the model class? > > \d --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---