tag:blogger.com,1999:blog-9014457088394059918.post3422974565318708176..comments2023-12-27T09:00:36.340+01:00Comments on DjangoTricks: Weather App Tutorial. Part 2 of 5. ModelsAidas Bendoraitis a.k.a. archatashttp://www.blogger.com/profile/18444891139539061590noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-9014457088394059918.post-46292135966866602452010-01-02T20:30:26.214+01:002010-01-02T20:30:26.214+01:00If you import the model like this, you are more fl...If you import the model like this, you are more flexible with the location of the app. Models might be under python path directly like appname.models or deeper under myproject.apps.appname.models or somepackage.appname.models. This way you can also use the trick about reusable models described in http://djangotricks.blogspot.com/2009/02/abstract-models-and-dynamicly-assigned.htmlAidas Bendoraitis a.k.a. archatashttps://www.blogger.com/profile/18444891139539061590noreply@blogger.comtag:blogger.com,1999:blog-9014457088394059918.post-28571961475592940502009-12-31T00:50:06.309+01:002009-12-31T00:50:06.309+01:00Is there a reason why you use
Location = models.ge...Is there a reason why you use<br />Location = models.get_model("climate_change", "Location")<br /><br />instead of importing the model with<br />from climate_change.models import Location<br /><br />I never saw it this way.Berndhttp://ubuntuverse.atnoreply@blogger.com