Dave,

     You're right, of course -- I want a ManyToMany field.
     The code you suggest doesn't quite work, either, though. Django
wants both models in a many-to-many relationship to inherit from
models.Model.
     Here's an interesting hack, though. Just change your first line
to...

          class MyDay(models.Model):

     ... and it works like I'd like it to, more or less. When I sync my
database, it creates an empty table for MyDays and a table for the
relationship. Now I can just instantiate new MyDate instances on the
fly and discard them when I'm through with them. They'll always have a
predictable id attribute ( from datetime.date.toordinal() ), so I don't
need to save them. I just associate an event with dates, save the event
and move on. The MyDays table stays empty.
     I'll have to play around a bit more to see if this breaks
somewhere. I've dinked with it in the shell, and so far so good.
     This solution still seems a bit kludgy to me, but less kludgy than
running out a whole table full of dates and going to the database every
time you want a date object.


--~--~---------~--~----~------------~-------~--~----~
 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to