Package Camelot :: Package camelot :: Package bin :: Module camelot_manage
[frames] | no frames]

Module camelot_manage

source code


camelot_manage is oriented towards administrators of an installed
camelot application. It is used for interacting the database, the model
and migration of the database to a certain schema revision.

To use this application, PYTHONPATH should contain a valid settings.py file that
will be used to resolve the database engine and the model.

.. cmdoption:: console

    Launches a python console with the model all setup for command line
    interaction.
    
    Within the example movie project one could do
    the following to print a list of all movie titles to the screen::
    
        from model import Movie
        for movie in Movie.query.all():
        print movie.title
    

.. cmdoption:: db_version

    Get the version of the database schema from the current database

.. cmdoption:: version

    Get the latest available database schema version

.. cmdoption:: upgrade

    Upgrade or downgrade the database to the specified version, use upgrade version_number.

.. cmdoption:: version_control

    Put the database under version control

.. cmdoption:: schema_display

    Generate a graph of the database schema.  The result is stored in schema.png.  This
    option requires pydot to be installed.

   .. image:: ../_static/schema.png
      :width: 400

Classes
  CommandOptionParser
  FileCacher
Cache the stdout text so we can analyze it before returning it
  Shell
Wrapper around Python that can filter input/output to the shell
Functions
 
schema_display(image_path='schema.png') source code
 
setup_model() source code
 
main() source code
Variables
  usage = 'usage: %prog [options] command'
  description = '\ncamelot_manage is oriented towards administra...
  command_description = [('console', 'Launches a python console ...
  __doc__ = "...
  __package__ = 'Camelot.camelot.bin'
  command = 'schema_display'
  desc = 'Generate a graph of the database schema. The result i...
  line = 'option requires pydot to be installed.'
Variables Details

description

Value:
'''
camelot_manage is oriented towards administrators of an installed
camelot application. It is used for interacting the database, the mode\
l
and migration of the database to a certain schema revision.

To use this application, PYTHONPATH should contain a valid settings.py\
 file that
...

command_description

Value:
[('console',
  '''Launches a python console with the model all setup for command li\
ne
interaction.

Within the example movie project one could do
the following to print a list of all movie titles to the screen::

...

__doc__

Value:
"""
camelot_manage is oriented towards administrators of an installed
camelot application. It is used for interacting the database, the mode\
l
and migration of the database to a certain schema revision.

To use this application, PYTHONPATH should contain a valid settings.py\
 file that
...

desc

Value:
'''Generate a graph of the database schema.  The result is stored in s\
chema.png.  This
option requires pydot to be installed.'''