Skip to content

Commit 71f5cb8

Browse files
committed
(docs): add links to Django docs in certain sections
- better document compatibility issues - refer to prefetch_related docs for syntax, etc - also fix wording / positioning so that it's more clear that this supports Python 3.x
1 parent 353eabd commit 71f5cb8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ It is expected that you already have Django installed
2626

2727
_This was originally used in an older Django 1.5 codebase with Python 2.7._
2828

29-
Should work with Django 1.4-1.9 with Python 2.7.
30-
- Likely works with Django 1.10 and 1.11, though not 100% sure that `._meta.fields` usage works the same way in these.
31-
- Will have some problems with Django 2.0 as the Manager's `use_for_related_fields` has been removed.
29+
Should work with Django 1.4-1.9 with Python 2.7-3.x.
30+
- Likely works with Django 1.10 and 1.11, though not 100% sure that [`._meta.fields` usage works the same way in these](https://docs.djangoproject.com/en/2.0/ref/models/meta/#migrating-old-meta-api).
31+
- Will have some problems with Django 2.0 as the Manager's [`use_for_related_fields` has been removed](https://docs.djangoproject.com/en/2.0/releases/2.0/#features-removed-in-2-0).
3232
- `2to3` shows that there is nothing to change, so should be compatible with Python 3.x
3333
- Likely works with Django 0.95-1.3 as well; pre 0.95, the Manager API didn't exist
3434
- Have not confirmed if this works with earlier versions of Python.
@@ -183,7 +183,7 @@ print User.objects.prefetch_related('post_set').get(pk=new_user.pk).serialize('p
183183

184184
<br>
185185

186-
`.serialize` takes in any number of joins as its `*args` and they can be of any depth, using the same `__` syntax as `prefetch_related`. This means if your `Post` object also had `Comment` objects, you could write:
186+
`.serialize` takes in any number of joins as its `*args` and they can be of any depth, using the same `__` syntax as [`prefetch_related`](https://docs.djangoproject.com/en/2.0/ref/models/querysets/#prefetch-related). This means if your `Post` object also had `Comment` objects, you could write:
187187

188188
```python
189189
User.objects.prefetch_related('post_set__comment_set').serialize('post_set__comment_set')

0 commit comments

Comments
 (0)