Re: advice in model design - principally
Hi Bruno, thanks for you search hints, maybe mine (database table layout...) was not the best choice for what I was looking for. I will give it a go again with your suggestions. Thx seb On Jan 16, 1:29 am, bruno desthuillierswrote: > On 15 jan, 13:05, _Sebastian_ wrote: > > > Hy all, > > > I'm trying to replicate a existing project database as a conceptual > > test. > > > I started off with creating a few models and I thought about ways on > > how I could link and/or organise them. As I'm just starting to learn > > django and python and my basic database knowledge is restricted to MS > > products I want to get some basic things right. > > > I'm talking not about the technical bits on how to write modules, > > fields and stuff I am thinking about how to organise tables, the > > underlying principles and rules. > > This is nothing specific to django (or almost, cf below). Google for > "relational model" and "relational database design", and "normal > form". Once you have a normalized data model, there may be a couple > Django-specific stuff - mostly, Django doesn't (yet) support compound > primary keys (so you'll have to use a surrogate key), and some > contribs (like generic) requires an integer primarry key, so better to > stick to it even if you do have a natural primary key. > > > I head a search and came > > acrosshttp://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=... > > which I am reading now but I was wondering if you know a better site > > to read about this sort of question? > > After a very quick look, it seems that the section about design might > be a good start. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: advice in model design - principally
On 15 jan, 13:05, _Sebastian_wrote: > Hy all, > > I'm trying to replicate a existing project database as a conceptual > test. > > I started off with creating a few models and I thought about ways on > how I could link and/or organise them. As I'm just starting to learn > django and python and my basic database knowledge is restricted to MS > products I want to get some basic things right. > > I'm talking not about the technical bits on how to write modules, > fields and stuff I am thinking about how to organise tables, the > underlying principles and rules. This is nothing specific to django (or almost, cf below). Google for "relational model" and "relational database design", and "normal form". Once you have a normalized data model, there may be a couple Django-specific stuff - mostly, Django doesn't (yet) support compound primary keys (so you'll have to use a surrogate key), and some contribs (like generic) requires an integer primarry key, so better to stick to it even if you do have a natural primary key. > I head a search and came across > http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=... > which I am reading now but I was wondering if you know a better site > to read about this sort of question? After a very quick look, it seems that the section about design might be a good start. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: advice in model design - principally
On Thursday 15 Jan 2009 6:04:13 pm _Sebastian_ wrote: > Could you elaborate on what you mean with 'then break them a bit for > speed'? well, 3 normal forms is the ideal - but we live in a real world. So after normalising the database, it is often found that repeating a field, or adding a field that can be calculated from existing fields in a table speeds up things enormously without significantly compromising database integrity. So we do it. It may not be necessary in a smaller database, but may be needed in a bigger one. -- regards KG http://lawgon.livejournal.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: advice in model design - principally
Kenneth, thank you for your reply. Could you elaborate on what you mean with 'then break them a bit for speed'? - seb On Jan 15, 11:22 pm, Kenneth Gonsalveswrote: > On Thursday 15 Jan 2009 5:35:56 pm _Sebastian_ wrote: > > > I head a search and came across > >http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=... > >bm.ddi.doc/ddi27.htm > > basically you would need to read up on the first three normal forms, try to > implement them and then break them a bit for speed if needed. Any site that > describes the normal forms is ok for that - this one seems ok. > > -- > regards > KGhttp://lawgon.livejournal.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: advice in model design - principally
On Thursday 15 Jan 2009 5:35:56 pm _Sebastian_ wrote: > I head a search and came across > http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.i >bm.ddi.doc/ddi27.htm basically you would need to read up on the first three normal forms, try to implement them and then break them a bit for speed if needed. Any site that describes the normal forms is ok for that - this one seems ok. -- regards KG http://lawgon.livejournal.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
advice in model design - principally
Hy all, I'm trying to replicate a existing project database as a conceptual test. I started off with creating a few models and I thought about ways on how I could link and/or organise them. As I'm just starting to learn django and python and my basic database knowledge is restricted to MS products I want to get some basic things right. I'm talking not about the technical bits on how to write modules, fields and stuff I am thinking about how to organise tables, the underlying principles and rules. Is it better to have more tables with fewer rows and link them. Or habe one large table... For the purpose of my test the project db will consist of many datasets for one project each. I would say that 90% of the Columns/ fields could be linked to a project number. Would that mean they should all be in one table, 100 or more columns? If not how should I organise them and link the separate tables? How do I decide what should go into a extra table? I know that it makes sense to have inn each project reoccurring selections as a linked table, but what else is there to know? I head a search and came across http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.ddi.doc/ddi27.htm which I am reading now but I was wondering if you know a better site to read about this sort of question? Thanks in advance. seb --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---