Re: Getting started with generic relations

2010-12-06 Thread mack the finger
I did read the docs. The ubiquious 'TaggedItem' example I just couldn't wrap my head around. I get it now though. For those who find this looking for a solution: Just add three fields to your model: content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField() item = gen

Re: Getting started with generic relations

2010-12-06 Thread bruno desthuilliers
On 5 déc, 20:30, mack the finger wrote: > I can't quite wrap my brain around how to do generic relations. I have > a `Receipt` model which is a receipt of a purchase. One of the fields > is `item` which is a foreign key to a product model. I want to be able > to not only have products, but other t

Getting started with generic relations

2010-12-05 Thread mack the finger
I can't quite wrap my brain around how to do generic relations. I have a `Receipt` model which is a receipt of a purchase. One of the fields is `item` which is a foreign key to a product model. I want to be able to not only have products, but other things that the user can buy. What do I need to d