If I understand you correctly, you (for example) have a quicktime1, in reel1
and reel2. In reel1 it is the first of, says 5 quicktimes, and in reel2 it
is the third of 4?
The best solution that appears to me is an extra column in the intermediary
table.
See:
http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships
Here you could specify a field called order.

To display you select everythong from the intermedirary model
'grouped_by=reel, order_by=order'.

Does this make any sense :D?

On Wed, Sep 17, 2008 at 8:51 PM, sethpomerantz <[EMAIL PROTECTED]>wrote:

>
> Hi,
>
> I am building a simple web app that allows me to create a custom web
> page of different quicktimes for presentation to clients and the like.
> I have it working fine , however i'd like to add control over the
> ordering of the quicktimes on the display pages. I am having a tough
> time understanding how to implement ordering for a Many-to-Many
> relationship, as each quicktime is used in multiple reels and would
> require having a different value for its order. I  would eventually
> like to integrate this into the admin interface so i can quickly
> define a specific order for a given reel.
>
> Here is a striped down version of my models:
>
> class Quicktime(models.Model):
>    name = models.CharField(max_length = 100)
>    order = models.IntegerField(blank = True, null = True)
>
>    def __unicode__(self):
>        return self.name
>
>    class Meta:
>        ordering = ('order',)
>
> class Reel(models.Model):
>    name = models.CharField(max_length = 100)
>    quicktimes = models.ManyToManyField(Quicktime)
>
>    def __unicode__(self):
>        return self.name
>
> thanks
> Seth Pomerantz
>
> >
>

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