Skip to content

Commit

Permalink
Updated documentation to stop errors/warning in generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Jenkins committed Dec 11, 2010
1 parent 9a6dce6 commit 0c33c69
Show file tree
Hide file tree
Showing 41 changed files with 604 additions and 439 deletions.
23 changes: 23 additions & 0 deletions docs/api/exceptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Exceptions
========================================================

Field Exceptions
--------------------------------

.. autoclass:: mongoalchemy.exceptions.BadValueException
:members:
:undoc-members:

.. autoclass:: mongoalchemy.exceptions.BadFieldSpecification
:members:
:undoc-members:


Document Exceptions
------------------------------------

.. autoexception:: mongoalchemy.document.DocumentException
.. autoexception:: mongoalchemy.document.MissingValueException
.. autoexception:: mongoalchemy.document.ExtraValueException
.. autoexception:: mongoalchemy.document.FieldNotRetrieved

1 change: 1 addition & 0 deletions docs/api/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Contents:
session
schema/index
expressions/index
exceptions

.. automodule:: mongoalchemy
:members:
Expand Down
7 changes: 0 additions & 7 deletions docs/api/schema/document.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,3 @@
:members:
:undoc-members:

Exceptions
----------------------------------------------------------
.. autoexception:: mongoalchemy.document.DocumentException
.. autoexception:: mongoalchemy.document.MissingValueException
.. autoexception:: mongoalchemy.document.ExtraValueException
.. autoexception:: mongoalchemy.document.FieldNotRetrieved

14 changes: 0 additions & 14 deletions docs/api/schema/fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,3 @@ Computed Field Objects
:undoc-members:

.. autofunction:: mongoalchemy.fields.computed_field
:members:
:undoc-members:

Exceptions
------------------------------------------------------------

.. autoclass:: mongoalchemy.fields.BadValueException
:members:
:undoc-members:

.. autoclass:: mongoalchemy.fields.BadFieldSpecification
:members:
:undoc-members:

2 changes: 1 addition & 1 deletion docs/build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 7976cd9fdcf5cccd17bcdcf6b19903d8
config: 03b0d7f77a8c4beb6dbc7e56f80fee5f
tags: fbb0d17656682115ca4d033fb2f83ba1
23 changes: 23 additions & 0 deletions docs/build/html/_sources/api/exceptions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Exceptions
========================================================

Field Exceptions
--------------------------------

.. autoclass:: mongoalchemy.exceptions.BadValueException
:members:
:undoc-members:

.. autoclass:: mongoalchemy.exceptions.BadFieldSpecification
:members:
:undoc-members:


Document Exceptions
------------------------------------

.. autoexception:: mongoalchemy.document.DocumentException
.. autoexception:: mongoalchemy.document.MissingValueException
.. autoexception:: mongoalchemy.document.ExtraValueException
.. autoexception:: mongoalchemy.document.FieldNotRetrieved

1 change: 1 addition & 0 deletions docs/build/html/_sources/api/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Contents:
session
schema/index
expressions/index
exceptions

.. automodule:: mongoalchemy
:members:
Expand Down
7 changes: 0 additions & 7 deletions docs/build/html/_sources/api/schema/document.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,3 @@
:members:
:undoc-members:

Exceptions
----------------------------------------------------------
.. autoexception:: mongoalchemy.document.DocumentException
.. autoexception:: mongoalchemy.document.MissingValueException
.. autoexception:: mongoalchemy.document.ExtraValueException
.. autoexception:: mongoalchemy.document.FieldNotRetrieved

16 changes: 1 addition & 15 deletions docs/build/html/_sources/api/schema/fields.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,4 @@ Computed Field Objects
:members:
:undoc-members:

.. autoclass:: mongoalchemy.fields.ComputedFieldValue
:members:
:undoc-members:

Exceptions
------------------------------------------------------------

.. autoclass:: mongoalchemy.fields.BadValueException
:members:
:undoc-members:

.. autoclass:: mongoalchemy.fields.BadFieldSpecification
:members:
:undoc-members:

.. autofunction:: mongoalchemy.fields.computed_field
2 changes: 2 additions & 0 deletions docs/build/html/_sources/examples/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
Examples
=================================

No examples yet. There are however code snippets throughout the documentation
and a few files here: https://github.com/jeffjenkins/MongoAlchemy/tree/master/examples
9 changes: 3 additions & 6 deletions docs/build/html/_sources/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Contents:

tutorial
api/index
examples/index

Introduction
-----------------------------
Expand Down Expand Up @@ -65,7 +66,7 @@ Examples
... bio = StringField(max_length=1000, required=False)
...
... # A computed field decorator allows values
... @ComputedField(SetField(StringField()), deps=[bio])
... @computed_field(SetField(StringField()), deps=[bio])
... def keywords(obj):
... return set(obj.get('bio','').split(' '))
...
Expand Down Expand Up @@ -93,12 +94,8 @@ Examples
... # into the database
... session.insert(me)
>>>
>>> # this is a QueryField object which can be used to construct queries,
... # as below. It can be used directly, but this is shorter
... f = User.f
>>>
>>> # Get a user with me's email address and MongoAlchemy in their bio (via keywords)
... db_user = session.query(User).filter(f.email == 'jeff@qcircles.net').in_(f.keywords, 'MongoAlchemy').one()
... db_user = session.query(User).filter(User.email == 'jeff@qcircles.net').in_(User.keywords, 'MongoAlchemy').one()
>>>
>>> db_user == me
True
Expand Down
22 changes: 8 additions & 14 deletions docs/build/html/_sources/tutorial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ add some of the cast of `Community`:
Querying
------------------------------

>>> for donor in session.query(BloodDonor).filter(BloodDonor.f.first_name == 'Jeff'):
>>> for donor in session.query(BloodDonor).filter(BloodDonor.first_name == 'Jeff'):
>>> print donor
Jeff Jenkins (male; Age: 28; Type: O+)
Jeff Winger (male; Age: 38; Type: O+)
Expand All @@ -98,31 +98,25 @@ The above code uses the :func:`~mongoalchemy.session.Session.query` method of
the ``session`` object to start a query on the BloodDonor collection. The
filter function on a query object allows constraints to be added to the
results returned. In this case all donors who have the name Jeff are being
printed. The :attr:`~mongoalchemy.document.Document.f` attribute of a
Document subclass is used to access the names of fields in such a way that
they generate query expressions which ``filter`` can use. ``f`` is only
needed for the outermost document type, so if the name were actually a
sub-document it might look like ``BloodDonor.f.name.first``.
printed. The attributes of a Document subclass are used to access the names
of fields in such a way that they generate query expressions which ``filter``
can use.

Multiple filters can be applied by chaining calls to filter or by adding
comma-separated query expressions inside a single call. The following two
examples return the same results:

>>> bdf = BloodDonor.f
>>> query = session.query(BloodDonor)
>>> for donor in query.filter(bdf.first_name == 'Jeff', bdf.age < 30):
>>> for donor in query.filter(BloodDonor.first_name == 'Jeff', BloodDonor.age < 30):
>>> print donor
Jeff Jenkins (male; Age: 28; Type: O+)

>>> query = session.query(BloodDonor)
>>> for donor in query.filter(bdf.first_name == 'Jeff').filter(bdf.age < 30):
>>> for donor in query.filter(BloodDonor.first_name == 'Jeff').filter(BloodDonor.age < 30):
>>> print donor
Jeff Jenkins (male; Age: 28; Type: O+)


The first thing to notice is that the ``f`` field of a document can be assigned to
a shorter name for convenience.

Instead of getting elements by iterating on the query, the :func:`~mongoalchemy.query.Query.one`
and :func:`~mongoalchemy.query.Query.first` methods can be used. ``one`` returns the first
result and raises an exception if there is not exactly one returned result. ``first`` returns
Expand All @@ -138,8 +132,8 @@ rather than updating results by loading an object and re-inserting it).
Here's an example where my age changed and it turned out I had the wrong
blood type:

>>> query = session.query(BloodDonor).filter(bdf.first_name == 'Jeff', bdf.last_name == 'Jenkins')
>>> query.inc(bdf.age, 1).set(bdf.blood_type, 'O-').execute()
>>> query = session.query(BloodDonor).filter(BloodDonor.first_name == 'Jeff', BloodDonor.last_name == 'Jenkins')
>>> query.inc(BloodDonor.age, 1).set(BloodDonor.blood_type, 'O-').execute()
>>> query.one()
Jeff Jenkins (male; Age: 29; Type: O-)

Expand Down
172 changes: 172 additions & 0 deletions docs/build/html/api/exceptions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Exceptions &mdash; MongoAlchemy v0.6 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.6',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="MongoAlchemy v0.6 documentation" href="../index.html" />
<link rel="up" title="API documentation" href="index.html" />
<link rel="next" title="Examples" href="../examples/index.html" />
<link rel="prev" title="Update Expressions" href="expressions/update_expressions.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../examples/index.html" title="Examples"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="expressions/update_expressions.html" title="Update Expressions"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">MongoAlchemy v0.6 documentation</a> &raquo;</li>
<li><a href="index.html" accesskey="U">API documentation</a> &raquo;</li>
</ul>
</div>

<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">

<div class="section" id="exceptions">
<h1>Exceptions<a class="headerlink" href="#exceptions" title="Permalink to this headline"></a></h1>
<div class="section" id="field-exceptions">
<h2>Field Exceptions<a class="headerlink" href="#field-exceptions" title="Permalink to this headline"></a></h2>
<dl class="class">
<dt id="mongoalchemy.exceptions.BadValueException">
<em class="property">class </em><tt class="descclassname">mongoalchemy.exceptions.</tt><tt class="descname">BadValueException</tt><big>(</big><em>name</em>, <em>value</em>, <em>reason</em>, <em>cause=None</em><big>)</big><a class="headerlink" href="#mongoalchemy.exceptions.BadValueException" title="Permalink to this definition"></a></dt>
<dd><p>An exception which is raised when there is something wrong with a
value</p>
</dd></dl>

<dl class="class">
<dt id="mongoalchemy.exceptions.BadFieldSpecification">
<em class="property">class </em><tt class="descclassname">mongoalchemy.exceptions.</tt><tt class="descname">BadFieldSpecification</tt><a class="headerlink" href="#mongoalchemy.exceptions.BadFieldSpecification" title="Permalink to this definition"></a></dt>
<dd><p>An exception that is raised when there is an error in creating a
field</p>
</dd></dl>

</div>
<div class="section" id="document-exceptions">
<h2>Document Exceptions<a class="headerlink" href="#document-exceptions" title="Permalink to this headline"></a></h2>
<dl class="exception">
<dt id="mongoalchemy.document.DocumentException">
<em class="property">exception </em><tt class="descclassname">mongoalchemy.document.</tt><tt class="descname">DocumentException</tt><a class="headerlink" href="#mongoalchemy.document.DocumentException" title="Permalink to this definition"></a></dt>
<dd><p>Base for all document-related exceptions</p>
</dd></dl>

<dl class="exception">
<dt id="mongoalchemy.document.MissingValueException">
<em class="property">exception </em><tt class="descclassname">mongoalchemy.document.</tt><tt class="descname">MissingValueException</tt><a class="headerlink" href="#mongoalchemy.document.MissingValueException" title="Permalink to this definition"></a></dt>
<dd><p>Raised when a required field isn&#8217;t set</p>
</dd></dl>

<dl class="exception">
<dt id="mongoalchemy.document.ExtraValueException">
<em class="property">exception </em><tt class="descclassname">mongoalchemy.document.</tt><tt class="descname">ExtraValueException</tt><a class="headerlink" href="#mongoalchemy.document.ExtraValueException" title="Permalink to this definition"></a></dt>
<dd><p>Raised when a value is passed in with no corresponding field</p>
</dd></dl>

<dl class="exception">
<dt id="mongoalchemy.document.FieldNotRetrieved">
<em class="property">exception </em><tt class="descclassname">mongoalchemy.document.</tt><tt class="descname">FieldNotRetrieved</tt><a class="headerlink" href="#mongoalchemy.document.FieldNotRetrieved" title="Permalink to this definition"></a></dt>
<dd><p>If a partial document is loaded from the database and a field which
wasn&#8217;t retrieved is accessed this exception is raised</p>
</dd></dl>

</div>
</div>


</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Exceptions</a><ul>
<li><a class="reference internal" href="#field-exceptions">Field Exceptions</a></li>
<li><a class="reference internal" href="#document-exceptions">Document Exceptions</a></li>
</ul>
</li>
</ul>

<h4>Previous topic</h4>
<p class="topless"><a href="expressions/update_expressions.html"
title="previous chapter">Update Expressions</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../examples/index.html"
title="next chapter">Examples</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/api/exceptions.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../examples/index.html" title="Examples"
>next</a> |</li>
<li class="right" >
<a href="expressions/update_expressions.html" title="Update Expressions"
>previous</a> |</li>
<li><a href="../index.html">MongoAlchemy v0.6 documentation</a> &raquo;</li>
<li><a href="index.html" >API documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2010, Jeffrey Jenkins.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.3.
</div>
</body>
</html>
Loading

0 comments on commit 0c33c69

Please sign in to comment.