Metadata-Version: 2.1
Name: orm
Version: 0.1.1
Summary: An async ORM.
Home-page: https://github.com/encode/orm
Author: Tom Christie
Author-email: tom@tomchristie.com
License: BSD
Description: # ORM
        
        **IN PROGRESS**
        
        *Seriously, it's in progress - we don't even have foreign key support in here
        yet. But it's a nice start.*
        
        **Note**: Use `ipython` to try this from the console, since it supports `await`.
        
        ```python
        import databases
        import orm
        import sqlalchemy
        
        database = databases.Database("sqlite:///db.sqlite")
        metadata = sqlalchemy.MetaData()
        
        
        class Note(orm.Model):
            __tablename__ = "notes"
            __database__ = database
            __metadata__ = metadata
        
            id = orm.Integer(primary_key=True)
            text = orm.String(max_length=100)
            completed = orm.Boolean(default=False)
        
        # Create the database
        engine = sqlalchemy.create_engine(str(database.url))
        metadata.create_all(engine)
        
        # .create()
        await Note.objects.create(text="Buy the groceries.", completed=False)
        await Note.objects.create(text="Call Mum.", completed=True)
        await Note.objects.create(text="Send invoices.", completed=True)
        
        # .all()
        notes = await Note.objects.all()
        
        # .filter()
        notes = await Note.objects.filter(completed=True).all()
        
        # exact, iexact, contains, icontains, lt, lte, gt, gte, in
        notes = await Note.objects.filter(text__icontains="mum").all()
        
        # .get()
        note = await Note.objects.get(id=1)
        
        # .update()
        await note.update(completed=True)
        
        # .delete()
        await note.delete()
        ```
        
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Description-Content-Type: text/markdown
