Skip to content

Commit

Permalink
Documentation overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
bintoro committed Nov 3, 2015
1 parent 860d717 commit 41157a1
Show file tree
Hide file tree
Showing 25 changed files with 245 additions and 633 deletions.
27 changes: 11 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ Some common use cases:
+ Custom `persistence layers <https://schematics.readthedocs.org/en/latest/usage/models.html#model-configuration>`_


Examples
--------
Example
=======

This is a simple Model.

::
This is a simple Model. ::

>>> from schematics.models import Model
>>> from schematics.types import StringType, URLType
Expand All @@ -57,17 +55,13 @@ This is a simple Model.
>>> person.name
u'Joe Strummer'

Serializing the data to JSON.

::
Serializing the data to JSON. ::

>>> import json
>>> json.dumps(person.to_primitive())
{"name": "Joe Strummer", "website": "http://soundcloud.com/joestrummer"}

Let's try validating without a name value, since it's required.

::
Let's try validating without a name value, since it's required. ::

>>> person = Person()
>>> person.website = 'http://www.amontobin.com/'
Expand All @@ -78,20 +72,21 @@ Let's try validating without a name value, since it's required.
raise ModelValidationError(e.messages)
schematics.exceptions.ModelValidationError: {'name': [u'This field is required.']}

Add the field and validation passes

::
Add the field and validation passes::

>>> person = Person()
>>> person.name = 'Amon Tobin'
>>> person.website = 'http://www.amontobin.com/'
>>> person.validate()
>>>


.. _coverage:

Testing & Coverage support
==========================
Run coverage and check the missing statements.

::
Run coverage and check the missing statements. ::

$ `coverage run --source schematics -m py.test && coverage report`

45 changes: 0 additions & 45 deletions docs/_themes/LICENSE

This file was deleted.

25 changes: 0 additions & 25 deletions docs/_themes/README.rst

This file was deleted.

86 changes: 0 additions & 86 deletions docs/_themes/flask_theme_support.py

This file was deleted.

22 changes: 0 additions & 22 deletions docs/_themes/kr_small/layout.html

This file was deleted.

0 comments on commit 41157a1

Please sign in to comment.