command candidates: sync_contenttypes and sync_permissions

24 views
Skip to first unread message

akaihola

unread,
Mar 27, 2009, 4:44:47 AM3/27/09
to django-extensions
I've taken Patrick Altman's script[1][2], updated it for Django 1.0
and turned it into two management commands.

These are handy if you don't use syncdb to add new models to the
database, or if you ever add a custom permission to an existing model.

The commands might be too seldom needed for inclusion in django-
extensions, but here goes anyway: The commit[3] is available on GitHub
and the patch[4] for download.

[1] http://paltman.com/2008/apr/11/keeping-contenttypes-and-permissions-updated-without-syncdb/
[2] http://www.djangosnippets.org/snippets/696/
[3] http://github.com/akaihola/django-extensions/tarball/commit/d563a01381a8841cc2aa4e61bf0897e077327176
[4] http://cloud.github.com/downloads/akaihola/django-extensions/sync-ct-perm.1.diff

andybak

unread,
Mar 27, 2009, 11:11:56 AM3/27/09
to django-extensions
I might be missing something here as I'm a Git newbie but your git
tree seems identical to the the main trunk and your diff file is
empty.

On Mar 27, 8:44 am, akaihola <akaih...@gmail.com> wrote:
> I've taken Patrick Altman's script[1][2], updated it for Django 1.0
> and turned it into two management commands.
>
> These are handy if you don't use syncdb to add new models to the
> database, or if you ever add a custom permission to an existing model.
>
> The commands might be too seldom needed for inclusion in django-
> extensions, but here goes anyway: The commit[3] is available on GitHub
> and the patch[4] for download.
>
> [1]http://paltman.com/2008/apr/11/keeping-contenttypes-and-permissions-u...
> [2]http://www.djangosnippets.org/snippets/696/
> [3]http://github.com/akaihola/django-extensions/tarball/commit/d563a0138...
> [4]http://cloud.github.com/downloads/akaihola/django-extensions/sync-ct-...

akaihola

unread,
Mar 30, 2009, 12:04:49 PM3/30/09
to django-extensions
On 27 maalis, 18:11, andybak <andy...@gmail.com> wrote:
> I might be missing something here as I'm a Git newbie but your git
> tree seems identical to the the main trunk and your diff file is
> empty.

The patched version lives in the sync-ct-perm branch.

Bas van Oostveen

unread,
Apr 10, 2009, 6:23:45 AM4/10/09
to django-e...@googlegroups.com
Could you please fork from the main django-extensions git repository and
recommit the patch there ?

I'm also thinking if we can roll these kind of commands into one.
For example:

./manage.py sync [permissions] [contenttypes] [etc]

('sync' might probably not the best command name here)

Other possibilities for a command like this could be:

- ImageField / File*Field, where is looks to the target directory and
sync any existing files there back into the table.

Can anybody think of other use cases for this ?

-Bas
Reply all
Reply to author
Forward
0 new messages