On 8/26/05, Maniac <[EMAIL PROTECTED]> wrote:
> What should I consider when choosing between them? I suppose choices
> tuple is easier to work with when making views since Django
> automatically generates <select> for it (or am I wrong here?). On the
> other hand lookup table is more flexible since I can extend it later to
> contain more than just 'name' field. Are there any other differences?

Django will use a <select> for both ForeignKeys and fields with
"choices" with them, so as far as your interface goes, it's
essentially the same.

Generally you'd use "choices" when the list of choices never changes
-- for stuff like "gender" or "age range" or "U.S. state". If your
list of related objects will change, use a ForeignKey.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com | chicagocrime.org

Reply via email to