On Fri, Sep 12, 2008 at 12:40 PM, phred78 <[EMAIL PROTECTED]> wrote: > > Hello all, > > I've been googling for hours and I can't figure this out. I'm working > on my first real project and came across a problem that some of you > might have already solved. > > I have a table called Products and one called Language. The client > will insert several products per language. This is fine and it's > working. > I have another table called Media, which will have several files > corresponding to a single product. I have this working via a > ManyToManyField related to the Products table, so when someone posts a > new media file it will be related to one or more products. This is > working as well. > > My big problem is that sometimes a product will have the same title in > all languages. So when listing related products on the Media admin > area, I'll have a list of more than one product with the same title. > This is, of course, confusing. > > My question is, how would I go about having a select box for my > products that list the title AND the language. For example: > > My lovely product | English > My lovely product | Norsk > My lovely product | Français > > Hope this makes sense. Can someone help? > > It's a little hard to be specific because you only very generally describe your model relationships here. But what is put in the select box for a model is what is returned by that model's __unicode__ method. So if you want to see language information in the select box for a Product, include language information in what Product's __unicode__ method returns. Presumably it is available via a ForeignKey to the Language table or something.
Karen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---