Skip to content

Commit

Permalink
fix README.rst
Browse files Browse the repository at this point in the history
  • Loading branch information
ebertti committed Aug 28, 2024
1 parent 29045fc commit 3864403
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ Installation

1. Requirements: **Django > 3** and **Python > 3**

2. ``pip install django-admin-easy==0.8.0``
``pip install django-admin-easy==0.8.0``


* For **Django < 1.8** or **Python 2.x**

``pip install django-admin-easy==0.4.1``
``pip install django-admin-easy==0.4.1``

* For **Django < 2**

``pip install django-admin-easy==0.7``
``pip install django-admin-easy==0.7.0``


How it Works
Expand Down Expand Up @@ -267,10 +267,13 @@ More Examples
# don't forget to use select_related with content-type to avoid N+1 queries like example below
generic = easy.GenericForeignKeyAdminField('generic')
# Example if your model has a field like this:
# content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
def queryset(self, queryset):
return queryset.select_related('content_type')
def get_queryset(self, request):
qs = super().get_queryset(request)
return qs.select_related('content_type')
# or enable cache
generic = easy.GenericForeignKeyAdminField('generic', cache_content_type=True)
# display image of some model
image1 = easy.ImageAdminField('image', {'image_attrs':'attr_value'})
Expand Down

0 comments on commit 3864403

Please sign in to comment.