arorm
arango orm with identity pattern
examples
import typing
from arorm import ListProperty, Field, ObjectProperty, PasswordField, Model, ReferenceId, Reference, ReferenceIdList, ReferenceList, Store, RemoteReferenceList
class UserAttributes(ObjectProperty):
class Settings(ObjectProperty):
notifications = Field(default=False)
html5Notifications = Field(default=False)
last_update: float = Field(default=0)
last_login: float = Field(default=0)
settings = Settings()
class User(Model):
__collection__ = 'users'
name = Field()
password = PasswordField(hidden=True)
email = Field()
attributes = UserAttributes()
achievements: typing.List[str] = ListProperty(str)
books: typing.List['Book'] = RemoteReferenceList('author_id', 'Book')
class Book(Model):
__collection__ = 'books'
author_id = ReferenceId()
author = Reference(author_id, User)
co_authors_ids = ReferenceIdList()
co_authors: typing.List[User] = ReferenceList(co_authors_ids, User)
db = dict(host='127.0.01', user='root', password='root', port=8529, driver='arango')
store = Store(db)
store.setup_db()
user = store.create(User) # will create a user on commit
book = store.create(Book) # will create a book on commit
book.author = user
book.co_authors.append(user)
store.query(User).filter(User.name == 'admin').delete() # queued to be executed on commit
store.run_after_commit(lambda: print('did commit'))
store.commit()
user.to_json() # -> will now have _id, _rev
book.to_json() # -> will now have author_id set to same id as user
Metadata
Release files for arorm 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| arorm-0.3.3.tar.gz | 10.4 kB | Without provenance | Details for arorm-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| arorm-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for arorm-0.3.3-py3-none-any.whl |
Total release size: 20.5 kB
Release files / arorm-0.3.3.tar.gz
| Download URL | arorm-0.3.3.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
03c4c2abd3f2f17b7797146781c6e1398a47d087866af92bb00413da6c1a883e
|
|
BLAKE2b-256 checksum How to use checksums |
d5b29e614ebbf9254f9e3e0f482944c876947917bb56e2e3c2a42e61e54973fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / arorm-0.3.3-py3-none-any.whl
| Download URL | arorm-0.3.3-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
775694cee0ddc157eb9424fdbf341455a2e162cd6334b108bdc60f6338c16d6c
|
|
BLAKE2b-256 checksum How to use checksums |
de07962fffd4ad251e96f467eb95e557623b2c8a37bf3ecde75507c814534c3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for arorm 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.