You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,21 +101,21 @@ We recommend the usage of our [JavaScript API Client](https://github.com/algolia
101
101
Use the `geo_field` attribute to localize your record. `geo_field` should be a callable that returns a tuple (latitude, longitude).
102
102
103
103
```python
104
-
classcontact(models.model):
105
-
name = models.charfield()
106
-
lat = models.floatfield()
107
-
lng = models.floatfield()
104
+
classContact(models.model):
105
+
name = models.CharField()
106
+
lat = models.FloatField()
107
+
lng = models.FloatField()
108
108
109
109
deflocation(self):
110
110
return (self.lat, self.lng)
111
111
112
112
113
-
classcontactindex(algoliaindex):
113
+
classContactIndex(AlgoliaIndex):
114
114
fields ='name'
115
115
geo_field ='location'
116
116
117
117
118
-
algoliasearch.register(contact, contactindex)
118
+
algoliasearch.register(Contact, ContactIndex)
119
119
```
120
120
121
121
# Tags
@@ -129,24 +129,24 @@ class ArticleIndex(AlgoliaIndex):
129
129
130
130
At query time, specify `{ tagFilters: 'tagvalue' }` or `{ tagFilters: ['tagvalue1', 'tagvalue2'] }` as search parameters to restrict the result set to specific tags.
131
131
132
-
# options
132
+
# Options
133
133
134
-
## custom `objectid`
134
+
## Custom `objectID`
135
135
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.
137
137
138
138
```python
139
139
classarticleindex(algoliaindex):
140
140
custom_objectid ='post_id'
141
141
```
142
142
143
-
## custom index name
143
+
## Custom index name
144
144
145
145
You can customize the index name. By default, the index name will be the name of the model class.
0 commit comments