Hello,
I am on django revision 880 and I like it a lot. Currently, I am
trying to get from a simple Model:
=============================
WEEKDAY_CHOICES = (
(0, 'Monday'),
(1, 'Tuesday'),
(2, 'Wednesday'),
(3, 'Thursday'),
(4, 'Friday'),
(5, 'Saturday'),
(6, 'Sunday'),
)
class Program(meta.Model):
wday = meta.IntegerField('Day', maxlength=1, choices=WEEKDAY_CHOICES)
=============================
to something like
=============================
WEEKDAY_CHOICES = (
(0, 'Monday'),
(1, 'Tuesday'),
(2, 'Wednesday'),
(3, 'Thursday'),
(4, 'Friday'),
(5, 'Saturday'),
(6, 'Sunday'),
)
class Weekday(meta.Model):
wday = meta.IntegerField('Day', maxlength=1, choices=WEEKDAY_CHOICES)
def __repr__(self):
return str(self.wday)
...
class Program(meta.Model):
weekday = meta.ManyToManyField(Weekday)
=============================
but this doesnt work! In the admin for Program, I get a select
multiple box filled with zeroes!
I could only get this to work by making Weekday an actual table (and
then filling in the weekday info manually)
class Weekday(meta.Model):
wday = meta.CharField('Day', maxlength=10)
any insight you might have is appreciated
thanks,
-frank