Skip to content

Commit 70c8709

Browse files
committed
fix README
1 parent ae97986 commit 70c8709

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,21 @@ We recommend the usage of our [JavaScript API Client](https://github.com/algolia
101101
Use the `geo_field` attribute to localize your record. `geo_field` should be a callable that returns a tuple (latitude, longitude).
102102

103103
```python
104-
class contact(models.model):
105-
name = models.charfield()
106-
lat = models.floatfield()
107-
lng = models.floatfield()
104+
class Contact(models.model):
105+
name = models.CharField()
106+
lat = models.FloatField()
107+
lng = models.FloatField()
108108

109109
def location(self):
110110
return (self.lat, self.lng)
111111

112112

113-
class contactindex(algoliaindex):
113+
class ContactIndex(AlgoliaIndex):
114114
fields = 'name'
115115
geo_field = 'location'
116116

117117

118-
algoliasearch.register(contact, contactindex)
118+
algoliasearch.register(Contact, ContactIndex)
119119
```
120120

121121
# Tags
@@ -129,24 +129,24 @@ class ArticleIndex(AlgoliaIndex):
129129

130130
At query time, specify `{ tagFilters: 'tagvalue' }` or `{ tagFilters: ['tagvalue1', 'tagvalue2'] }` as search parameters to restrict the result set to specific tags.
131131

132-
# options
132+
# Options
133133

134-
## custom `objectid`
134+
## Custom `objectID`
135135

136-
you can choose which field will be used as the `objectid`. the field should be unique and can be a string or integer. by default, we use the `pk` field of the model.
136+
You can choose which field will be used as the `objectID `. The field should be unique and can be a string or integer. By default, we use the `pk` field of the model.
137137

138138
```python
139139
class articleindex(algoliaindex):
140140
custom_objectid = 'post_id'
141141
```
142142

143-
## custom index name
143+
## Custom index name
144144

145145
You can customize the index name. By default, the index name will be the name of the model class.
146146

147147
```python
148-
class contactindex(algoliaindex):
149-
index_name = 'entreprise'
148+
class ContactIndex(algoliaindex):
149+
index_name = 'Entreprise'
150150
```
151151

152152
## Index settings

0 commit comments

Comments
 (0)