Let's say I have a model with a field called "status". I could set the
choices in three ways:

1)   status_choices = ((1, 'Completed'), (2, 'Unfinished'), (3,
'Cancelled'))


2)  status_choices = (('COM', 'Completed'), ('UNF', 'Unfinished'),
('CAN', 'Cancelled'))


Or, 3 ):

db_choices = Choice.objects.all()
status_choices = [[choice.pk, choice.description] for choice in
db_choices]

Is there any best practice? Note: Client's won't be able to define
these choices. They'll all be defined by me (or else DB would be the
answer of course).

My thoughts:

1) Risky (data is useless without python file), 2) Slower, and risky
because it might be difficult to change later, 3) a lot of work, and
slow (because of DB).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to