views:

82

answers:

1

Hi People.

I'm trying to solve the relational model in order to make a Django app.

I't will be something like a McDonald's crew scheduler. I mean the grid with colored pins marking who will be working at a given hour a given weekday.

I did try to Google out some example, but I didn't find anything. I need some theory/bibliography in order to build up my model and code it into my app.

Thanks in advance

+2  A: 

From the short description, you probably wouldn't have just one model in your app.

From your question I'm assuming you don't have a lot of experience with databases... Here are a few suggestions:

Start here because if you don't understand the basic principles of database design, foreign keys, one-to-one, one-to-many, many-to-many, etc etc etc; you will have a hard time designing your Django models.

It would be nice to learn SQL too. Django models are supposed to insulate you from it, but in reality it is using SQL underneath and knowing SQL will enable you to check and fix performance issues in the future. There are some resources online too. And if you are using SQLite, learn its syntax too.

The above is stuff that you will be able to reuse regardless of the web framework you end up with. Django, Rails, the next big thing... whatever.

Study other people's data models. Here are several different ones - maybe you can find the one you are looking for (employee shifts? shift scheduling?).

Then read the basic django model documentation and really understand it. What django models are doing is mapping python objects to relational database tables (ORM is the acronym; Object Relational Mapping) and this article may very well help you in coming up with good designs.

Don't get discouraged. Everybody had to start somewhere.

Hope you find all you need. Have fun with Django.

celopes
http://databaseanswers.org/data%5Fmodels/index.htm is *exactly* what I'm looking for, and anything else you added is quite useful too.Thank you very much.
Pablo