Skip to content

Commit bc0a3dd

Browse files
committed
Update Documentation
1 parent a8df230 commit bc0a3dd

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ You need to inherit from The Base Document Classes mentioned above to build a do
9898

9999
#### Simple Example
100100

101-
For Django Model:
101+
**1. For Django Model:**
102102

103103
```python
104104
# models.py
@@ -114,7 +114,7 @@ class Category(models.Model):
114114
return self.name
115115
```
116116

117-
You can create a document class like this:
117+
**2. You can create a document class like this:**
118118

119119
**Note:** Document classes must be stored in `documents.py` file.
120120

@@ -132,19 +132,19 @@ class CategoryDocument(JsonDocument):
132132
fields = ["name", "slug"]
133133
```
134134

135-
Run Index Django Management Command to create the index on Redis:
136-
137-
**Note:** This will also populate the index with existing data on the database
135+
**3. Run Index Django Management Command to create the index on Redis:**
138136

139137
```bash
140138
python manage.py index
141139
```
142140

141+
**Note:** This will also populate the index with existing data on the database
142+
143143
Now category objects will be indexed on create/update/delete.
144144

145145
#### More Complex Example
146146

147-
For Django Models:
147+
**1. For Django Models:**
148148

149149
```python
150150
# models.py
@@ -179,7 +179,7 @@ class Product(models.Model):
179179
return self.name
180180
```
181181

182-
You can create a document classes like this:
182+
**2. You can create a document classes like this:**
183183

184184
**Note:** Document classes must be stored in `documents.py` file.
185185

@@ -263,14 +263,14 @@ class ProductDocument(JsonDocument):
263263
- Field names must match model field names or define a `prepare_{field_name}` method.
264264

265265

266-
Run Index Django Management Command to create the index on Redis:
267-
268-
**Note:** This will also populate the index with existing data on the database
266+
**3. Run Index Django Management Command to create the index on Redis:**
269267

270268
```bash
271269
python manage.py index
272270
```
273271

272+
**Note:** This will also populate the index with existing data on the database
273+
274274

275275
### Management Command
276276

@@ -438,7 +438,6 @@ For more details checkout [redis-py docs](https://redis.readthedocs.io/en/stable
438438

439439
### Settings
440440

441-
442441
#### Environment Variables
443442

444443
- **`REDIS_OM_URL`** (Default: `redis://localhost:6379`): This environment variable follows the `redis-py` URL format. If you are using external redis server

0 commit comments

Comments
 (0)