[Tutor] design question (Django?)
Alan Gauld
alan.gauld at btinternet.com
Sat Apr 13 10:00:12 CEST 2013
Some clarification please.
> (1) Database design. Here are the database tables I think are necessary:
> tblPostalcode: pc6, streetname, nHouseholds, isVisitable, remarks
> tblCollectorSelection: collectorname, streetname, selectiondate
streetname is in both so presumably is the link between collector and
the postcodes? Can a steetname be in multiple postcodes? So if a
collector selects a street does he implicitly select multiple post codes?
And
Does a postcode only have a single street? (Ours can have several)
I assume isVisitable is a derived field that you are going to calculate
each time based on the number of collectors who have selected the
postcode? If so it may be easier and more efficient to have a mapping
table to manage the relationship of collectors to postcodes and another
table for the collector data (although you don't appear to be holding
much collector data, which surprises me... I assume the users will be
collectors with login credentials etc?)
As always when modelling data the important information is the
relationships between the entities and I'm not sure I understand
the relationships between street, postcode and collector.
HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
More information about the Tutor
mailing list