Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
romaryd committed May 24, 2018
1 parent d26492d commit 0f110b1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,11 @@ class Message(namedtuple('Message', fields),


class MessagesRepository(Repository):
prefix = 'messages'
klass = Message


# make a singleton for our repository
my_repository = MessagesRepository()
my_repository = MessagesRepository(backend='dict', prefix='messages')
msg1 = Message(title='Message1',
content='and this is the content')
msg2 = Message(title='Message2',
Expand All @@ -77,9 +76,9 @@ be used to define access to a Redis server.

```python
class MessagesRepository(Repository):
prefix = 'messages'
klass = Message
backend = 'redis'

my_repository = MessagesRepository(backend='redis', prefix='messages')
```

### DynamoDB
Expand All @@ -90,10 +89,10 @@ Names of key and sort_key must configured.

```python
class MessagesRepository(Repository):
prefix = 'messages'
klass = Message
backend = 'dynamodb'
key = 'KEY'
sort_key = 'DATE'
key = 'key'
sort_key = 'date'

my_repository = MessagesRepository(backend='dynamodb', prefix='messages')
```

0 comments on commit 0f110b1

Please sign in to comment.