This may be beyond the scope of this project, but it would be nice to have a command which could easily automate the task of repairing a database which was migrated from MySQL to PostgreSQL (a common task with Django). The common issue is that you can lose the PK sequencing (which is stored in sequences in PG, and not in MySQL). If the sequences are not correct, inserting new records causes a failure.
The process is something like...
For each table (if not specified):
1. Select PK field & sort DESC
2. Update the appropriate sequence to the latest PK
Not a complex process, but quite tedious when done by hand. Bearing the future in mind, this would also be useful when migrating to any DB that uses sequences (i.e. Oracle).
I don't know if it already exists (I wasn't able to find it) but it will be very cool to have django_bash_completion working with django-command-extensions.
A command to list and/or remove files under MEDIA_ROOT that are not referenced in the database. I am imagining something like "manage.py list_unreferenced_files" with either another command for remove or a flag to remove, or even just piping that into rm/xargs like find.
If I have time, I will put together some code for this. But I just wanted to get this idea out there if I don't have time.
BTW, I see this as something useful when I in development mode and I get a LOT of old files after dropping/recreating the database a lot. Not really a production task.
CreationUserField?, ModificationUserField?: Similar to CreationDateTimeField? and ModificationDateTimeField?, but would record the id of the logged in user. I need this capability for my project, so I'd be willing to write and contribute patches.
Apps have fine-grained permissions, exposed in the admin as options like "Can add question" for a quiz app. In templates, you can use tags like
{% if perms.quiz.add_question %}
The Django docs are unclear on how to discover a list of all possible codenames. In other words it's unclear how to write a template tag like the one above because you assume it will be
{% if perms.quiz.can_add_question %}
There's no simple way to get a list of actual permission codenames. A good addition would be a "show_codenames" option that would do exactly that. Thanks.
clean-pyc -- recursively delete pyc files
This may be beyond the scope of this project, but it would be nice to have a command which could easily automate the task of repairing a database which was migrated from MySQL to PostgreSQL (a common task with Django). The common issue is that you can lose the PK sequencing (which is stored in sequences in PG, and not in MySQL). If the sequences are not correct, inserting new records causes a failure.
The process is something like...
For each table (if not specified):
1. Select PK field & sort DESC
2. Update the appropriate sequence to the latest PK
Not a complex process, but quite tedious when done by hand. Bearing the future in mind, this would also be useful when migrating to any DB that uses sequences (i.e. Oracle).
@rockmhoward, added clean_pyc and compile_pyc to svn
@kyzylh, if you have some code for that ?
I don't know if it already exists (I wasn't able to find it) but it will be very cool to have django_bash_completion working with django-command-extensions.
Is that possible ?
A command to list and/or remove files under MEDIA_ROOT that are not referenced in the database. I am imagining something like "manage.py list_unreferenced_files" with either another command for remove or a flag to remove, or even just piping that into rm/xargs like find.
If I have time, I will put together some code for this. But I just wanted to get this idea out there if I don't have time.
BTW, I see this as something useful when I in development mode and I get a LOT of old files after dropping/recreating the database a lot. Not really a production task.
@clairon, yeah that would be very cool !! if anybody would like to write the the /etc/bash_completion.d/django_extensions script ? :)
CreationUserField?, ModificationUserField?: Similar to CreationDateTimeField? and ModificationDateTimeField?, but would record the id of the logged in user. I need this capability for my project, so I'd be willing to write and contribute patches.
Apps have fine-grained permissions, exposed in the admin as options like "Can add question" for a quiz app. In templates, you can use tags like
{% if perms.quiz.add_question %}
The Django docs are unclear on how to discover a list of all possible codenames. In other words it's unclear how to write a template tag like the one above because you assume it will be
{% if perms.quiz.can_add_question %}
There's no simple way to get a list of actual permission codenames. A good addition would be a "show_codenames" option that would do exactly that. Thanks.
extend autoload in shell_plus with a customizable script (so I can autoload helper functions/parameters)