python - Array of foreign keys in Django Model -


I'm not sure that this is the best title, but I'm having trouble writing it plainly. Actually, I Building a model that represents the business. It includes and address, time of operation, etc. It has operating hours that are tripping me I have my address

  class address (models.Model): --snip-- business = model. Foreign Key (BusinessInfo)  

So each business has one or more location addresses I am looking for to do this with hours

  square hourhand (model) .model): Open = isOpen = Model. Booleanfield () Open = Model Timefield (Null = true) off = Model Timefield (Null = True)  

I want to apply it that every business should have an array of 7 hours - one day of each week for. I can not feel stumbling in a clear, elegant way to do this. Is this a good way to model in the Django?

Use a lot of:

 time code (model. Model): model = Model: model = model = model. Boolean field (open) = model Timefield (tap = true) off = model Timefield (null = true) class day (model model): hours = model. Many Tom Manfield (HoursAnne) Class Business (Model.Model): Day = Models. Many Accessories (Days)  

If you want to keep the limit for 7 thousand and 7 days, then you Can see


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -