Could you create a City model and a County model and relate them one County to many Cities? I'm not sure how to populate those tables.
As an aside, where do you get your City to County data. I've been meaning to look for that data. Do all cities cleanly break into one county?
John Thomas
310-947-8572
On Wed, Jun 28, 2017 at 9:55 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:
I want to add a lookup table to my application. The table will have two
columns: city_name and county. This will allow me to return all rows for
companies in a specific county (or all companies sorted by county). I know
how to do this with SQL and want to learn how to implement this capability
in django (1.11.2 currently installed). Pointers to the appropriate docs
much appreciated.
Rich
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJ22gMDeSMPOnUAGoXs3990C_LjawtwLDB1f4pkReoWOGMbb2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment