I guess I found a lead at tests\modeltests\m2m_intermediary\

if anyone knows if that's correct (or wrong as hell), please let me know :-)



On 7/17/06, Carlos Yoder <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I'm building a sort of b2b app that lists a car catalogue. A car can
> have multiple 'special prices', linked to groups of wholesalers. So
> when wholesaler W logs into the app, he should  see a 'special price
> just for you' control, displaying the proper price.
>
> In a custom app I'd have a 'modified' m2m relationship, sort of like this:
>
> SpecialPrices
> idCars (int FK)
> idWholesalers (int FK)
> Price (float)
>
> The problem is, I don't know how to do this in Django. I tried doing:
>
> class SpecialPrice(models.Model):
>         """ A price for a special user (company)"""
>         user    = models.ForeignKey(User)
>         special_price = models.FloatField("Custom Price", max_digits=9,
> decimal_places=2)
>
> class Car(models.Model):
> #...
>         special_prices = models.ManyToManyField(SpecialPrice,
> filter_interface=models.HORIZONTAL)
>
>
> ... but that's not what I mean. I need the special prices to be unique
> to Car and Wholesaler.
>
>
> Could anyone be so kind as to shed some light on how to do this, the Django 
> way?
>
> Mil gracias,
>
> --
> Carlos Yoder
> http://carlitosyoder.blogspot.com
>


-- 
Carlos Yoder
http://carlitosyoder.blogspot.com

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

Reply via email to