Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1.14 KB

README.md

File metadata and controls

38 lines (29 loc) · 1.14 KB

json_repository

Donate  travis build Pypi Downloads Downloads codecov.io

Install

https://pypi.org/project/json-repository/ pip install json-repository

Examples

You can also go to tests to check a good how-to!

Creating custom repository

class Foo(object):
    foo = None
    bar = None
    id = None

class FoobarRepository(BaseJsonRepository):
  def __init__(self):
    super(FoobarRepository, self).__init__(Foo)

using created repository

  with FoobarRepository() as repo:
    for entity in repo.get_all():
      repo.delete(entity)
    repo.context.commit()