djangosnippets.org: Latest snippets posted by tomzeehttps://djangosnippets.org/users/tomzee/2007-12-26T13:23:09.546543-06:00tomzeeField map for models
2007-12-26T13:23:09.546543-06:00tomzeehttps://djangosnippets.org/snippets/525/<p>It seems like one way or another I always need to get access to a specific field of a Model object. The current way to do this is to iterate through the object's _meta.fields list, comparing with the <code>name</code> attribute. Why not just have a lookup of fields? If you …</p>
Freely redistributablefreshdb management command
2007-12-24T08:11:44.045923-06:00tomzeehttps://djangosnippets.org/snippets/521/<p>This is useful especially during the model-creation stage, when things are in constant flux. The <code>freshdb</code> command will drop the project's database, then create a new one. A common use case:</p>
<p>manage.py freshdb</p>
<p>manage.py syncdb</p>
Freely redistributable