Django/PostgreSQL implementation of the Meteor server.
Find a file
2015-04-08 16:14:22 +10:00
dddp Django DDP version 0.2.0 2015-04-08 16:14:22 +10:00
test_project Django DDP version 0.2.0 2015-04-08 16:14:22 +10:00
.gitignore Ignore .ropeproject/ 2015-02-23 15:30:14 +11:00
LICENSE Initial commit 2015-02-19 16:32:10 +11:00
README.rst Django DDP version 0.2.0 2015-04-08 16:14:22 +10:00
setup.py Django DDP version 0.2.0 2015-04-08 16:14:22 +10:00

django-ddp
==========

Django/PostgreSQL implementation of the Meteor DDP service, allowing Meteor to subsribe to changes on Django models.

Example usage
-------------

.. code:: python

    # bookstore/ddp.py
    
    from dddp.api import API, Collection, Publication
    from bookstore import models
    
    class Book(Collection):
        model = models.Book
    
    
    class Author(Collection):
        model = models.Author
    
    
    class AllBooks(Publication):
        queries = [
            models.Author.objects.all(),
            models.Book.objects.all(),
        ]
    
    
    class BooksByAuthorEmail(Publication):
        def get_queries(self, author_email):
            return [
                models.Author.objects.filter(
                    email=author_email,
                ),
                models.Book.objects.filter(
                    author__email=author_email,
                ),
            ]
    
    
    API.register(
        [Book, Author, AllBooks, BooksByAuthorEmail]
    )

.. code:: sh

    # start DDP service using default port (8000)
    $ manage.py dddp