Skip to content
This repository has been archived by the owner on Mar 30, 2020. It is now read-only.

Commit

Permalink
welcome v.0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
orsinium committed Jan 3, 2018
1 parent d53f1d3 commit 75ff556
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 10 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Documentation on other languages:
**DjBurger** -- patched views format for big projects on Django.


Key principes:
Key principles:

1. Validation only before main logic.
2. Reusable logic for many views.
Expand Down Expand Up @@ -145,8 +145,6 @@ class UsersView(djburger.ViewBase):
}
```

For more info view docstrings.


## External libraries support

Expand All @@ -168,3 +166,11 @@ For more info view docstrings.
* [Tablib](https://github.com/kennethreitz/tablib)
* `djburger.r.Tablib`


## What's next?

1. Read [documentation](https://djburger.readthedocs.io/en/latest/), source code docstrings or just inspect djburger from python console (for example, `help('djburger.views')`).
2. See [example](example/) project.
3. If you have some questions then [view issues](https://github.com/orsinium/djburger/issues) or [create new](https://github.com/orsinium/djburger/issues/new).
4. If you found some mistakes then fix it and [create Pull Request](https://github.com/orsinium/djburger/compare). Contributors are welcome.
5. [Star this project on github](https://github.com/orsinium/djburger) :)
64 changes: 58 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Documentation on other languages:

**DjBurger** -- patched views format for big projects on Django.

Key principes:
Key principles:

1. Validation only before main logic.
2. Reusable logic for many views.
Expand Down Expand Up @@ -123,15 +123,56 @@ View definition:
rules = {
'get': djburger.rule(
c=lambda request, data, **kwargs: 'Hello, World!',
postv=djburger.v.c.IsStrValidator,
postr=djburger.s.ExceptionSerializer,
postv=djburger.v.c.IsStr,
postr=djburger.r.Exception(),
r=djburger.r.Template(template_name='index.html'),
),
}
Minimum info:

.. code:: python
class ExampleView(djburger.ViewBase):
default_rule = djburger.rule(
c=lambda request, data, **kwargs: 'Hello, World!',
r=djburger.r.Template(template_name='index.html'),
),
Rule from ``default_rule`` will be used as rule for all requests, which
method not definited in ``rules``.

Big example:

.. code:: python
class UsersView(djburger.ViewBase):
rules = {
'get': djburger.rule(
d=[login_required, csrf_exempt],
prev=SomeValidator,
c=djburger.c.List(model=User),
postv=djburger.v.c.QuerySet,
postr=djburger.r.Exception(),
r=djburger.r.JSON(),
),
'put': djburger.rule(
d=[csrf_exempt],
p=djburger.p.JSON(),
prev=SomeOtherValidator,
c=djburger.c.Add(model=User),
r=djburger.r.JSON(),
),
}
External libraries support
--------------------------

- `BSON <https://github.com/py-bson/bson>`__

- ``djburger.p.BSON``
- ``djburger.r.BSON``

- `Django REST Framework <django-rest-framework.org>`__

- ``djburger.v.b.RESTFramework``
Expand All @@ -156,7 +197,18 @@ External libraries support

- ``djburger.r.Tablib``

- `BSON <https://github.com/py-bson/bson>`__
What's next?
------------

- ``djburger.p.BSON``
- ``djburger.r.BSON``
1. Read `documentation <https://djburger.readthedocs.io/en/latest/>`__,
source code docstrings or just inspect djburger from python console
(for example, ``help('djburger.views')``).
2. See `example <example/>`__ project.
3. If you have some questions then `view
issues <https://github.com/orsinium/djburger/issues>`__ or `create
new <https://github.com/orsinium/djburger/issues/new>`__.
4. If you found some mistakes then fix it and `create Pull
Request <https://github.com/orsinium/djburger/compare>`__.
Contributors are welcome.
5. `Star this project on
github <https://github.com/orsinium/djburger>`__ :)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name = 'djburger',
version = '0.7.1',
version = '0.8.0',

author = 'orsinium',
author_email = 'master_fess@mail.ru',
Expand Down

0 comments on commit 75ff556

Please sign in to comment.