Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed trailing whitespace, fixed typos #92

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ that might aid you in contributing to `sandman`.

* Create a new, Python 2.7+ virtualenv and install the requirements via pip: `pip install -r requirements.txt`
* Make sure you have a [GitHub account](https://github.com/signup/free)
* Either sumbit an issue directly on GitHub or head to `sandman's` [Waffle.io](https://waffle.io/jeffknupp/sandman) page
* Either submit an issue directly on GitHub or head to `sandman's` [Waffle.io](https://waffle.io/jeffknupp/sandman) page
* For bugs, clearly describe the issue including steps to reproduce
* For enhancement proposals, be sure to indicate if you're willing to work on implementing the enhancement
* Fork the repository on GitHub

## Making Changes

* `sandman` uses [git-flow](http://nvie.com/posts/a-successful-git-branching-model/) as the git branching model
* **No commits should be made directly to `master`**
* **No commits should be made directly to `master`**
* [Install git-flow](https://github.com/nvie/gitflow) and create a `feature` branch like so: `$ git flow feature start <name of your feature>`
* Make commits of logical units.
* Check for unnecessary whitespace with `git diff --check` before committing.
* Make sure you have added the necessary tests for your changes.
* Make sure you have added the necessary tests for your changes.
* Test coverage is currently at 100% and tracked via [coveralls.io](https://coveralls.io/r/jeffknupp/sandman?branch=develop)
* Aim for 100% coverage on your code
* If this is not possible, explain why in your commit message
* This may be an indication that your code should be refactored
* If you're creating a totaly new feature, create a new class in `test_sandmand.py` that inherits from `TestSandmanBase`
* If you're creating a totally new feature, create a new class in `test_sandmand.py` that inherits from `TestSandmanBase`
* Run `python setup.py test` to make sure your tests pass
* Run `coverage run --source=sandman setup.py test` if you have the `coverage` package installed to generate coverage data
* Check your coverage by running `coverage report`
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ Discuss
-------

Looking for a place to ask questions about sandman? Check out the <a href="https://groups.google.com/forum/#!forum/sandman-discuss">sandman-discuss</a> and <a href="https://groups.google.com/forum/#!forum/sandman-users">sandman-users</a> forums!

Documentation
-------------

[Sandman documentation](https://sandman.readthedocs.org/en/latest/)

`sandman` "makes things REST". Have an existing database you'd like to expose via
a REST API? Normally, you'd have to write a ton of boilerplate code for
the ORM you're using, then integrate that into some web framework.
the ORM you're using, then integrate that into some web framework.

I don't want to write boilerplate.

Expand Down Expand Up @@ -91,7 +91,7 @@ activate()
app.run()
```

**You don't even need to tell `sandman` what tables your database contains.**
**You don't even need to tell `sandman` what tables your database contains.**
Just point `sandman` at your database and let it do all the heavy lifting

Let's start our new service and make a request. While we're at it, lets make use
Expand Down Expand Up @@ -196,8 +196,8 @@ With `sandman`, zero boilerplate code is required. In fact, using `sandmanctl`,
structure and schema is introspected and your database tables magically get a
RESTful API and admin interface. For each table, `sandman` creates:

* proper endpoints
* support for a configurable set of HTTP verbs
* proper endpoints
* support for a configurable set of HTTP verbs
* GET
* POST
* PATCH
Expand All @@ -213,7 +213,7 @@ RESTful API and admin interface. For each table, `sandman` creates:
`sandman` is under active development but should be usable in any environment due
to one simple fact:

**`sandman` never alters your database unless you add or change a record yourself. It adds no extra tables to your existing database and requires no changes to any of your existing tables. If you start `sandman`, use it to browse your database via cURL, then stop `sandman`, your database will be in exactly the same state as it was before you began.**
**`sandman` never alters your database unless you add or change a record yourself. It adds no extra tables to your existing database and requires no changes to any of your existing tables. If you start `sandman`, use it to browse your database via cURL, then stop `sandman`, your database will be in exactly the same state as it was before you began.**

### Installation

Expand Down Expand Up @@ -245,7 +245,7 @@ Questions or comments about `sandman`? Hit me up at [[email protected]](mailto:
* Support for using existing declarative models alongside `sandman` generated models
* If you have an existing app and want to include sandman in it, simply pass
your existing models in to the `register()` function along with any
`sanmdman` generated classes. `sandman` will detect the existing models
`sandman` generated classes. `sandman` will detect the existing models
and augment them.

## Version 0.9.5
Expand Down Expand Up @@ -273,7 +273,7 @@ Questions or comments about `sandman`? Hit me up at [[email protected]](mailto:

* The `meta` endpoint
* All resources now have a `/<resource>/meta` endpoint that describes the
types of each of their fields (both in HTML and JSON)
types of each of their fields (both in HTML and JSON)
* The root endpoint
* A "root" endpoint (`/`) has been created. It lists all resources
registered in the application and includes URLs to their various
Expand All @@ -298,7 +298,7 @@ Questions or comments about `sandman`? Hit me up at [[email protected]](mailto:
* Nested JSON models no longer the default; hitting a URL with the argument "expand"
will show one level of nested resources
* This conforms more closely to REST principles while not sacrificing the
functionality.
functionality.


## Version 0.7.8
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ database using ``sandman``:
.. code:: bash

$ sandmanctl sqlite:////tmp/my_database.db

**Use an absolute path to the database or a 'full' URI** such as:
- postgresql+psycopg2://scott:tiger@localhost/test
- sqlite+pysqlite:///relative/path/to/db.db
Expand Down Expand Up @@ -280,7 +280,7 @@ Version 0.9.6

- If you have an existing app and want to include sandman in it,
simply pass your existing models in to the ``register()`` function
along with any ``sanmdman`` generated classes. ``sandman`` will
along with any ``sandman`` generated classes. ``sandman`` will
detect the existing models and augment them.

Version 0.9.5
Expand Down
14 changes: 7 additions & 7 deletions docs/admin.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ The sandman Admin Interface
Activating the sandman Admin Interface
--------------------------------------

sandman supports an admin interface, much like the Django admin
sandman supports an admin interface, much like the Django admin
interface. ``sandman`` currently uses [Flask-Admin](https://flask-admin.readthedocs.org/en/latest/)
and some SQLAlchemy, erm, alchemy to allow your resources to be
administered via the admin interface. Note, though, that the admin
and some SQLAlchemy, erm, alchemy to allow your resources to be
administered via the admin interface. Note, though, that the admin
interface may drastically change in the future.

Here's a look at the interface generated for the ``chinook`` database's
Expand All @@ -25,8 +25,8 @@ making changes via the admin.
The admin interface (which adds an ``/admin`` endpoint to your
service, accessible via a browser), is enabled by default. To disable it, pass
``admin=False`` as an argument in your call to ``activate``.
By default, calling this function will make _all_ Models accessible in the admin.
If you'd like to prevent this, simply call ``register()`` with ``use_admin=False``
By default, calling this function will make _all_ Models accessible in the admin.
If you'd like to prevent this, simply call ``register()`` with ``use_admin=False``
for whichever Model/Models you don't want to appear. Alternatively, you can
control if a model is viewable, editable, creatable, etc in the admin by
setting your class's ``__view__`` attribute to your own ``Admin`` class.
Expand All @@ -36,8 +36,8 @@ Getting Richer Information for Related Objects

The sharp-eyed among you may have noticed that the information presented for
``Album``, ``Genre``, and ``MediaType`` are not very helpful. By default, the
value that will be shown is the value returned by ``__str__`` on the
associated table. Currently, ``__str__`` simply returns the value of a Model's
value that will be shown is the value returned by ``__str__`` on the
associated table. Currently, ``__str__`` simply returns the value of a Model's
``primary_key()`` attribute. By overriding ``__str__``, however, we can display
more useful information. After making the changes below::

Expand Down
4 changes: 2 additions & 2 deletions docs/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Authentication
==============

``sandman`` supports HTTP basic authentication, meaning a username and password
must be passed on each request via the ``Authorization`` header.
must be passed on each request via the ``Authorization`` header.

Enabling Authentication
-----------------------
Expand All @@ -22,7 +22,7 @@ authentication. The latter is used to ensure that _all_ requests are authorized.

The ``get_password`` function takes a ``username`` as an argument and should
return the associated password for that user. To notify Flask-HTTPAuth that this
is the function responsible for returning passwords, it must be wrapped with the
is the function responsible for returning passwords, it must be wrapped with the
``@auth.get_password`` decorator (``auth`` is importable from ``sandman``, e.g.
``from sandman import app, db, auth``). How you implement your user
management system is up to you; you simply need to implement ``get_password`` in
Expand Down
10 changes: 5 additions & 5 deletions docs/using_sandman.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Beyond `sandmanctl`
**Notice you don't even need to tell ``sandman`` what tables your database contains.**
Just point ``sandman`` at your database and let it do all the heavy lifting.

If you put the code above into a file named ``runserver.py``, You can start this new
If you put the code above into a file named ``runserver.py``, You can start this new
service and make a request. While we're at it, lets make use
of ``sandman``'s awesome filtering capability by specifying a filter term::

Expand Down Expand Up @@ -86,7 +86,7 @@ you should see the following::
If you were to leave off the filtering term, you would get **all** results from
the ``Artist`` table. You can also *paginate* these results by specifying ``?page=2``
or something similar. The number of results returned per page is controlled by
the config value ``RESULTS_PER_PAGE``, which defaults to 20.
the config value ``RESULTS_PER_PAGE``, which defaults to 20.

A Quick Guide to REST APIs
~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -115,7 +115,7 @@ Creating Models

A ``Model`` represents a table in your database. You control which tables to
expose in the API through the creation of classes which inherit from
:class:`sandman.model.models.Model`. If you create a ``Model``, the only attribute you
:class:`sandman.model.models.Model`. If you create a ``Model``, the only attribute you
must define in your class is the ``__tablename__`` attribute. ``sandman`` uses this to map your
class to the corresponding database table. From there, ``sandman`` is able to divine
all other properties of your tables. Specifically, ``sandman`` creates the
Expand Down Expand Up @@ -290,8 +290,8 @@ The ``/meta`` endpoint
----------------------

A ``/meta`` endpoint, which lists the models attributes (i.e. the database
columns) and their type. This can be used to create client code that is
decoupled from the structure of your database.
columns) and their type. This can be used to create client code that is
decoupled from the structure of your database.

A ``/meta`` endpoint is automatically generated for every ``Model`` you register.
This is available both as JSON and HTML.
Expand Down