> Thanks, but damn, isn't that overly complicated (for me). Using through
> looks like a easier way, but then I have to add Wheel four times and can't
> just type '4' in some field, since I don't need it to exist in database four
> time, just an information that there are four wheels.

as I said, it depends on what you want. If you want an inventory
(different types of blocks, and how many you have of each) then it's
good enough that way. If you want to model actually building stuff
with legos, it might not be enough, that's all I'm saying.

For an inventory I'd do this:

class LegoPiece(Model) has it's data, plus an IntegerField, total amount..

As I said before, with your car example.. if you just want to know how
many of a part are in a car, Then what you did is enough, then you
could have some cars, and some pieces, say

Cars = (Motorcycle, 4x4, Car)
Parts = (Tire, Transmission, Door)
PartsInCar = ((Motorcycle, Tire, 2),(Motorcycle, Transmission, 1),
(4x4, Tire, 4), (4x4, Transmission, 2), (4x4, Door, 2), (Car, Tire,
4), (Car, Transmission, 1), (Car, Door, 4))

This would achieve a description of how may parts you need to make a given car..

-- 
"The whole of Japan is pure invention. There is no such country, there
are no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to