Skip to content

Commit dcc695e

Browse files
majdalRoss Mechanic
authored andcommitted
Update common_issues.rst (#580)
Added section "Pointing to the model", taken verbatim from #332
1 parent 0cfd85d commit dcc695e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/common_issues.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,16 @@ If you have ``django-modeltranslation`` installed, you will need to use the ``re
192192
method to model translation, as described `here`_.
193193

194194
.. _here https://github.com/treyhunner/django-simple-history/issues/209#issuecomment-181676111
195+
196+
197+
Pointing to the model
198+
---------------------
199+
200+
Sometimes you have to point to the model of the historical records. Examples are Django's generic views or Django REST framework's serializers. You can get there through your HistoricalRecords manager you defined in your model. According to our example:
201+
202+
.. code-block:: python
203+
204+
class PollHistoryListView(ListView): # or PollHistorySerializer(ModelSerializer):
205+
class Meta:
206+
model = Poll.history.model
207+
# ...

0 commit comments

Comments
 (0)