Skip to content
Browse files

updating docs

  • Loading branch information...
1 parent baa3133 commit 949a274cf758264a53a87851a70806237e7ff110 @sorl sorl committed Feb 6, 2011
Showing with 20 additions and 21 deletions.
  1. +7 −1 docs/conf.py
  2. +0 −1 docs/contribute.rst
  3. +0 −1 docs/index.rst
  4. +2 −3 docs/installation.rst
  5. +0 −1 docs/mockups.rst
  6. +2 −3 docs/registry.rst
  7. +8 −10 docs/usage.rst
  8. +1 −1 mockups/helpers.py
View
8 docs/conf.py
@@ -11,7 +11,9 @@
# All configuration values have a default; values that are commented out
# serve to show the default.
-import sys, os
+import sys
+import os
+from os.path import abspath, dirname, join as pjoin
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
@@ -20,6 +22,10 @@
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
+here = abspath(dirname(__file__))
+sys.path.append(pjoin(here, os.pardir))
+
+
# -- General configuration -----------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be extensions
View
1 docs/contribute.rst
@@ -1,6 +1,5 @@
Contribute
==========
-
If you want to use an isolated environment while hacking on
``django-mockups`` you can run the following commands from the project's
root directory::
View
1 docs/index.rst
@@ -1,6 +1,5 @@
Welcome to django-mockups's documentation!
==============================================
-
This app aims to provide a simple way of loading masses of randomly generated
test data into your development database. You can use a :ref:`management
command <mockups>` to load test data through command line.
View
5 docs/installation.rst
@@ -3,7 +3,6 @@ Installation
Download and install with pip or easy_install
---------------------------------------------
-
You can install the ``django-mockups`` like any other python package. The
prefered way is to use `pip <http://pypi.python.org/pypi/pip>`_. Please run the
following command in your terminal::
@@ -23,16 +22,16 @@ not available on your system::
.. _INSTALLED_APPS:
+
Add mockups to your django project
----------------------------------
-
Usually you want to add ``mockups`` to your ``INSTALLED_APPS`` in the
settings file of your django project. This will make the :ref:`mockups
<mockups>` management command available to your use.
+
Using the development version
-----------------------------
-
You can ofcourse also install and use the current development version. All you
need is to have the `git <http://git-scm.com/>`_ and `setuptools
<http://pypi.python.org/pypi/setuptools>`_ installed.
View
1 docs/mockups.rst
@@ -2,5 +2,4 @@
The mockups management command
===============================
-
.. automodule:: mockups.management.commands.mockups
View
5 docs/registry.rst
@@ -1,6 +1,5 @@
The mockup registry
===================
-
.. _registry:
Since :class:`ModelMockup` is designed to fit for almost all models, its very
@@ -16,9 +15,9 @@ command or with one of the :ref:`shortcuts <shortcuts>` in :mod:`mockups`.
.. autofunction:: mockups.unregister
-Included ModelMockup subclasses
---------------------------
+Included ModelMockup subclasses
+-------------------------------
There are some :class:`ModelMockup` subclasses that are shipped by default
with ``django-mockups``. These are listed below.
View
18 docs/usage.rst
@@ -2,16 +2,14 @@
Howto use the library
=====================
+Its easy to get started with the :ref:`mockups <mockups>` management command
+but its quite limited if you want to have more control of how your test data
+should be created. This chapter describes how you use the library in your
+python environment like the shell, a custom script or in unittests.
-Its easy to get started with the :doc:`mockups management command
-<mockups>` but its quite limited if you want to have more control of how
-your test data should be created. This chapter describes how you use the
-library in your python environment like the shell, a custom script or in
-unittests.
Creating model instances
------------------------
-
The :mod:`mockups` module contains a few shortcuts to make the creation of
test data as fast as possible.
@@ -21,18 +19,18 @@ test data as fast as possible.
.. autofunction:: mockups.create_one
+
.. _ModelMockup:
Using the ModelMockup class
-----------------------
-
+---------------------------
.. autoclass:: mockups.base.ModelMockup
- :members: __init__, add_field_generator, add_constraint, check_constrains,
+ :members: __init__, update_fieldname_generator, add_constraint, check_constrains,
create, create_one
+
Subclassing :class:`ModelMockup`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
The following methods may be overwritten by subclasses:
.. automethod:: mockups.base.ModelMockup.prepare_class
View
2 mockups/helpers.py
@@ -85,7 +85,7 @@ def unregister(model_or_iterable, fail_silently=False):
def create(model, count, *args, **kwargs):
'''
Create *count* instances of *model* using the either an appropiate
- mockup that was :ref:`registry <registered>` or fall back to the
+ mockup that was :ref:`registry <registry>` or fall back to the
default:class:`ModelMockup` class. *model* can be a model class or its
string representation (e.g. ``"app.ModelClass"``).

0 comments on commit 949a274

Please sign in to comment.
Something went wrong with that request. Please try again.