Tuesday, June 1, 2010

select multiple without using foreignkey

I have a models that represents an event.

I want it to have a field that represents the days of the week that
the event occurs. This is easy if all you need to be able to do is be
able to select one day, but if you want to select multiple, the right
way seems to be to create a DayOfWeek object, create 7 instances in
your db, the use ManyToMany relations. To me that just seems wrong.
I'd rather store it as a string like "WFS" or "MWF". Is there an easy
way to do this in django?

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate