Am trying to get the hang of specifying my models, so bear with me ...

Suppose that I want to reprsent states and the cities that are in
them.  I think I would have a model that looks like this:

class State(models.Model):
    name = models.CharField('name', max_length=20)

class City(models.Model):
    name = models.CharField('name', max_length=20)
    state = models.ForeignKey(State)

Now, suppose that cities can have the same name, as long as they are
in different states, and I want a way to check that when the user adds
a city, that he/she doesn't add it twice for the same state.  IE, the
user has data for certain states and cities and wants to add only
those for which there is data.  The user will manually click on "add
state", which will take them to a page where they input some state
data and then can click a 'submit' button to save it.  And also from
that window they can click on an 'add city' button that will take them
to a window where they can input data for a city and then submit
that.  If I want to make sure that the same city isn't added twice for
the same state, do I simply do that check when the city data is
"posted"?  IE, if they try to add the same city twice, I just give an
error saying it's already there?

What if I want the user to be able to enter a whole bunch of cities at
once, for example by entering them all in a table on a single page.
What would be the appropriate way to represent that table?

Sorry, I know these are probably very basic questions, just want to
make sure I am on the right track.

May I ask - is there anyone in the SF Bay area that would be
interested in providing some irelatively nexpensive consulting to me
to get me bootstrapped?  I'm thinking a few hours to get me off and
running, with perhaps continued time as needed.  I live in Menlo Park
and work in Santa Clara.  Have tons of software and python experience,
but no practical experience with django, sql, and web clients.  The
project I am working on is a project management tool to manage the
process of chip design (the state/city thing above is just an
analogy).

Thanks!

Margie

--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to