Links
repository: https://bitbucket.org/imbolc/odbm/
russian docs: http://pysi.org/lab/odbm/
Installation
$ pip install odbm
Usage
>>> from datetime import datetime
>>> import odbm
>>> class User(odbm.Model):
... username = odbm.UnicodeProperty(primary_key=True)
... friends = odbm.Property(default=[], key='f')
... created = odbm.DateTimeProperty(key='c')
...
... __backend__ = staticmethod(lambda: dict())
>>> User(
... username = 'foo',
... friends = ['bar', 'baz'],
... created = datetime.now(),
... ).save()
>>> User(username='bar', created = datetime.now()).save()
>>> User(username='baz', created = datetime.now()).save()
>>> User.get('foo').friends
['bar', 'baz']
>>> [u.username for u in User.find(
... filter = lambda u: not u.friends,
... order = lambda x: x.created)]
[u'bar', u'baz']
>>> User.count()
3
>>> User.count(lambda u: 'baz' in u.friends)
1
>>> User.find_one().delete()
>>> User.count()
2
Release files for odbm 0.5.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| odbm-0.5.6.tar.gz | 5.0 kB | Details |
Release files / odbm-0.5.6.tar.gz
| Download URL | odbm-0.5.6.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4ca8c7d259a7c2fe751b35ce4d691612b35c8fca070fa28c0098558594f4408
|
|
BLAKE2b-256 checksum How to use checksums |
8ed6c8114959dd1b9bb94a25a39547b175ea74935110da28305da73fa2cf68de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |