Permalink
Browse files

Added documentation for the cms management command

Added nicer help to the cms command
  • Loading branch information...
1 parent a040642 commit f2e738f5ee97b8d60ee6abb85c6b4d24fba7dcba Jonas Obrist committed Aug 4, 2011
Showing with 75 additions and 4 deletions.
  1. +12 −2 cms/management/commands/cms.py
  2. +2 −2 cms/management/commands/subcommands/list.py
  3. +60 −0 docs/advanced/cli.rst
  4. +1 −0 docs/index.rst
@@ -14,12 +14,22 @@ class Command(SubcommandsCommand):
make_option('--noinput', action='store_false', dest='interactive', default=True,
help='Tells django-cms to NOT prompt the user for input of any kind. '),
)
+
+ args = '<subcommand>'
command_name = 'cms'
- help = 'Various django-cms commands'
subcommands = {
'uninstall': UninstallCommand,
'list': ListCommand,
'moderator': ModeratorCommand,
- }
+ }
+
+ @property
+ def help(self):
+ lines = ['django CMS command line interface.', '', 'Available subcommands:']
+ for subcommand in sorted(self.subcommands.keys()):
+ lines.append(' %s' % subcommand)
+ lines.append('')
+ lines.append('Use `manage.py cms <subcommand> --help` for help about subcommands')
+ return '\n'.join(lines)
@@ -9,9 +9,9 @@ class ListApphooksCommand(NoArgsCommand):
help = 'Lists all apphooks in pages'
def handle_noargs(self, **options):
- urls = Title.objects.values_list("application_urls", flat=True)
+ urls = Title.objects.filter(application_urls__gt='').values_list("application_urls", flat=True)
for url in urls:
- self.stdout.write(url+'\n')
+ self.stdout.write('%s\n' % url)
class ListPluginsCommand(NoArgsCommand):
View
@@ -0,0 +1,60 @@
+######################
+Command Line Interface
+######################
+
+.. highlight:: bash
+
+You can invoke the django CMS command line interface using the ``cms`` Django
+command::
+
+ python manage.py cms
+
+**********************
+Informational commands
+**********************
+
+``cms list``
+============
+
+The ``list`` command is used to display information about your installation.
+
+It has two subcommands:
+
+* ``cms list plugins`` lists all plugins that are used in your project.
+* ``cms list apphooks`` lists all apphooks that are used in your project.
+
+
+**************************************
+Plugin and apphook management commands
+**************************************
+
+The ``uninstall`` subcommand can be used to make an uninstallation of a CMS
+Plugin or an apphook easier.
+
+It has two subcommands:
+
+* ``cms uninstall plugins <plugin name> [<plugin name 2> [...]]`` uninstalls
+ one or several plugins by **removing** them from all pages where they are
+ used.
+* ``cms uninstall apphooks <apphook name> [<apphook name 2> [...]]`` uninstalls
+ one or several apphooks by **removing** them from all pages where they are
+ used.
+
+.. warning::
+
+ The uninstall command **permanently deletes** data from your database.
+ You should make a backup of your database before using them!
+
+
+******************
+Moderator commands
+******************
+
+If you turn :setting:`CMS_MODERATOR` to ``True`` on an existing project, you
+should use the ``cms moderator on`` command to make the required changes in the
+database, otherwise you will have problems with invisible pages.
+
+.. warning::
+
+ This command **alters data** in your database. You should make a backup of
+ your database before using it!
View
@@ -37,6 +37,7 @@ Advanced
advanced/i18n
advanced/sitemap
advanced/templatetags
+ advanced/cli
*****************

0 comments on commit f2e738f

Please sign in to comment.