Skip to content

Commit

Permalink
Merge c7d6d61 into 3ee8277
Browse files Browse the repository at this point in the history
  • Loading branch information
Relrin committed Nov 29, 2016
2 parents 3ee8277 + c7d6d61 commit 0d03d64
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 15 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Features

Requirements
-----
- Python >= 3.4.0
- Autobahn.ws >= 0.12.1
- Python >= 3.4.2
- Autobahn.ws == 0.16.0

Optional:
- SQLAlchemy ORM >= 1.0
Expand Down Expand Up @@ -54,8 +54,7 @@ Getting started
var ws = null;
var isopen = false;

window.onload = function()
{
window.onload = function() {
ws = new WebSocket("ws://127.0.0.1:8080");
ws.onopen = function() {
console.log("Connected!");
Expand Down Expand Up @@ -103,7 +102,7 @@ class HelloClientProtocol(WebSocketClientProtocol):


if __name__ == '__main__':
factory = WebSocketClientFactory("ws://localhost:8080", debug=False)
factory = WebSocketClientFactory("ws://localhost:8080")
factory.protocol = HelloClientProtocol

loop = asyncio.get_event_loop()
Expand Down
1 change: 0 additions & 1 deletion docs/source/app.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ handler. It can be method-based:
from aiorest_ws.views import MethodBasedView
class HelloWorld(MethodBasedView):
def get(self, request, *args, **kwargs):
return "Hello, world!"
Expand Down
9 changes: 5 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@

# General information about the project.
project = 'aiorest-ws'
copyright = '2015, Valeryi Savich'
copyright = '2016, Valeryi Savich'
author = 'Valeryi Savich'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '1.0'
version = '1.1'
# The full version, including alpha/beta/rc tags.
release = '1.0'
release = '1.1.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -136,6 +136,7 @@
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {
'logo': 'logo.png',
'description': 'REST framework with WebSockets support',

'github_user': 'Relrin',
Expand Down Expand Up @@ -172,7 +173,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['static', ]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
10 changes: 5 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Features
- Authentication (using JSON Web Token)
- Customizing behaviour of your application through settings file
- Compressing messages for minimize of transmitted traffic (if your browser support)
- Model serializing for Django and SQLAlchemy ORM
- SSL support

Library installation
Expand All @@ -43,8 +44,7 @@ Client example (JavaScript):
var ws = null;
var isopen = false;
window.onload = function()
{
window.onload = function() {
ws = new WebSocket("ws://127.0.0.1:8080");
ws.onopen = function() {
console.log("Connected!");
Expand Down Expand Up @@ -93,7 +93,7 @@ Client example (Python):
if __name__ == '__main__':
factory = WebSocketClientFactory("ws://localhost:8080", debug=False)
factory = WebSocketClientFactory("ws://localhost:8080")
factory.protocol = HelloClientProtocol
loop = asyncio.get_event_loop()
Expand Down Expand Up @@ -157,15 +157,15 @@ Contents:
---------

.. toctree::
:maxdepth: 2
:maxdepth: 3

auth
app
request
routing
serializing
wrappers
views
api

Indices and tables
==================
Expand Down
172 changes: 172 additions & 0 deletions docs/source/serializing.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
.. _aiorest-ws-serializing:

Model serializing
=================

.. currentmodule:: aiorest_ws.db.orm

Serializers which will be described below give to a programmer opportunities to convert complex
data structures like model instances of certain ORM to the default Python datatypes. The result
of this processing can be returned to a user in JSON, XML or any other formats. These serializers
also provide deserializing mechanisms which can be used for parsing and validating user input data
that will be used for to work with ORMs further.

These serializers largely based on ideas of Django REST Framework. In this way a lot of
functionality that will be described further will coincide with this library.

At the moment aiorest-ws have support with the following ORMs:

- Django
- SQLAlchemy

You can find corresponding modules for each of mentioned ORMs in ``aiorest_ws.db.orm.*`` namespace.

Serializers
-----------

Defining model serializer
^^^^^^^^^^^^^^^^^^^^^^^^^

Serializing
^^^^^^^^^^^

Deserializing
^^^^^^^^^^^^^

Validating and saving instances
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Partial instance updates
^^^^^^^^^^^^^^^^^^^^^^^^

Work with multiple objects
^^^^^^^^^^^^^^^^^^^^^^^^^^

Work with nested objects
^^^^^^^^^^^^^^^^^^^^^^^^

Serializer fields
-----------------

BigIntegerField
^^^^^^^^^^^^^^^

BooleanField
^^^^^^^^^^^^

CharField
^^^^^^^^^

ChoiceField
^^^^^^^^^^^

CreateOnlyDefault
^^^^^^^^^^^^^^^^^

DateField
^^^^^^^^^

DateTimeField
^^^^^^^^^^^^^

DecimalField
^^^^^^^^^^^^

DictField
^^^^^^^^^

DurationField
^^^^^^^^^^^^^

EmailField
^^^^^^^^^^

EnumField
^^^^^^^^^

FileField
^^^^^^^^^

FilePathField
^^^^^^^^^^^^^

FloatField
^^^^^^^^^^

HStoreField
^^^^^^^^^^^

IPAddressField
^^^^^^^^^^^^^^

ImageField
^^^^^^^^^^

IntegerField
^^^^^^^^^^^^

IntervalField
^^^^^^^^^^^^^

JSONField
^^^^^^^^^

LargeBinaryField
^^^^^^^^^^^^^^^^

ListField
^^^^^^^^^

ModelField
^^^^^^^^^^

MultipleChoiceField
^^^^^^^^^^^^^^^^^^^

NullBooleanField
^^^^^^^^^^^^^^^^

PickleField
^^^^^^^^^^^

ReadOnlyField
^^^^^^^^^^^^^

RegexField
^^^^^^^^^^

SerializerMethodField
^^^^^^^^^^^^^^^^^^^^^

SlugField
^^^^^^^^^

SmallIntegerField
^^^^^^^^^^^^^^^^^

TimeField
^^^^^^^^^

URLField
^^^^^^^^

UUIDField
^^^^^^^^^

Serializer relation fields
--------------------------

PrimaryKeyRelatedField
^^^^^^^^^^^^^^^^^^^^^^

HyperlinkedRelatedField
^^^^^^^^^^^^^^^^^^^^^^^

HyperlinkedIdentityField
^^^^^^^^^^^^^^^^^^^^^^^^

StringRelatedField
^^^^^^^^^^^^^^^^^^

SlugRelatedField
^^^^^^^^^^^^^^^^

0 comments on commit 0d03d64

Please sign in to comment.