Re: Should I use generic foreign key, and how?

2014-08-17 Thread Amirouche Boubekki
2014-08-17 11:24 GMT+02:00 Vladimir Chukharev : > > > On Saturday, August 16, 2014 10:46:33 PM UTC+3, Aaron Law wrote: >> >> >> Hi all, >> >> I have php web programming background, and new to Django. I am helping my >> brother to build an online system to manage inventory, and I've got a >> datab

Re: Should I use generic foreign key, and how?

2014-08-17 Thread Vladimir Chukharev
On Saturday, August 16, 2014 10:46:33 PM UTC+3, Aaron Law wrote: > > > Hi all, > > I have php web programming background, and new to Django. I am helping my > brother to build an online system to manage inventory, and I've got a > database design & coding problem recently. Needing help! > > Tha

Re: Should I use generic foreign key, and how?

2014-08-17 Thread Amirouche Boubekki
2014-08-16 21:45 GMT+02:00 Aaron Law : > > Hi all, > > I have php web programming background, and new to Django. I am helping my > brother to build an online system to manage inventory, and I've got a > database design & coding problem recently. Needing help! > > That is, I have a set of tables of

Re: Should I use generic foreign key, and how?

2014-08-17 Thread Davide Scatto
another way is not to use fk but generic field, where patent_id is a normal integer field. In a custom manager you have to manage the data content in this field with data content in table field to retrieve yr linked record. Il giorno sabato 16 agosto 2014 21:46:33 UTC+2, Aaron Law ha scritto: >

Re: Should I use generic foreign key, and how?

2014-08-16 Thread Collin Anderson
I think there really are two ways to do it, as you say. Either use a GenericForeignKey(), or have multiple ForeignKey(null=True, blank=True), each one pointing to a different model. I personally use the multiple foreign keys approach, but this is the case that GenericForeignKey was designed for

Should I use generic foreign key, and how?

2014-08-16 Thread Aaron Law
Hi all, I have php web programming background, and new to Django. I am helping my brother to build an online system to manage inventory, and I've got a database design & coding problem recently. Needing help! That is, I have a set of tables of "possible products", "inventory", "suppiler", etc. I