django
Django migration strategy for renaming a model and relationship fields
I’m planning to rename several models in an existing Django project where there are many other models that have foreign key relationships to the models I would like to rename. I’m fairly certain this will require multiple migrations, but I’m not sure of the exact procedure.
django-rest-framework 3.0 create or update in nested serializer
With django-rest-framework 3.0 and having these simple models:
When should I use ugettext_lazy?
I have a question about using ugettext and ugettext_lazy for translations.
I learned that in models I should use ugettext_lazy, while in views ugettext.
But are there any other places, where I should use ugettext_lazy too? What about form definitions?
Are there any performance diffrences between them?
Find object in list that has attribute equal to some value (that meets any condition)
I’ve got a list of objects. I want to find one (first or whatever) object in this list that has an attribute (or method result – whatever) equal to value.
Django Local Settings
I’m trying to use local_setting in Django 1.2, but it’s not working for me. At the moment I’m just adding local_settings.py to my project.
Get all related Django model objects
How can I get a list of all the model objects that have a ForeignKey pointing to an object? (Something like the delete confirmation page in the Django admin before DELETE CASCADE).
How to duplicate virtualenv
I have an existing virtualenv with a lot of packages but an old version of Django.
How do I get the object if it exists, or None if it does not exist in Django?
When I ask the model manager to get an object, it raises DoesNotExist when there is no matching object.
Best practices for adding .gitignore file for Python projects?
I’m trying to collect some of my default settings, and one thing I realized I don’t have a standard for is .gitignore files. There’s a great thread showing a good .gitignore for Visual Studio projects, but I don’t see many recommendations for Python and related tools (PyGTK, Django). So far, I have… *.pyc *.pyo …for … Read more