Skip to content

Commit

Permalink
add compatibility with last version of deps (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewsmedina authored and Asif Saifuddin Auvi committed Nov 29, 2016
1 parent b20ec95 commit a95e211
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
1 change: 1 addition & 0 deletions djadmin2/admin2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class GroupSerializer(Admin2APISerializer):

class Meta:
model = Group
fields = '__all__'


class GroupAdmin2(ModelAdmin2):
Expand Down
1 change: 1 addition & 0 deletions djadmin2/apiviews.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class ModelAPISerilizer(Admin2APISerializer):

class Meta:
model = model_class
fields = '__all__'

return ModelAPISerilizer
return super(Admin2APIMixin, self).get_serializer_class()
Expand Down
11 changes: 8 additions & 3 deletions djadmin2/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,22 @@ def build_date_filter(request, model_admin, queryset, field_name="published_date
filterset_dict = {
"year": NumericDateFilter(
name=field_name,
lookup_type="year",
lookup_expr="year",
),
"month": NumericDateFilter(
name=field_name,
lookup_type="month",
lookup_expr="month",
),
"day": NumericDateFilter(
name=field_name,
lookup_type="day",
lookup_expr="day",
)
}
filterset_dict["Meta"] = type(
type_str('Meta'),
(object, ),
{"model": queryset.model, "fields": [field_name]},
)

return type(
type_str('%sDateFilterSet' % queryset.model.__name__),
Expand Down
1 change: 1 addition & 0 deletions djadmin2/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class Admin2Inline(extra_views.InlineFormSet):
adds some useful functionality.
"""
template = None
fields = '__all__'

def construct_formset(self):
"""
Expand Down
Binary file modified example/db.sqlite3
Binary file not shown.
1 change: 1 addition & 0 deletions example/polls/admin2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class ChoiceInline(Admin2TabularInline):
model = Choice
fields = '__all__'
extra = 3


Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ def run_tests(self):
#test_suite='runtests.runtests',
install_requires=[
'django>=1.8.0',
'django-extra-views<=0.7.1',
'django-extra-views==0.8.0',
'django-braces>=1.3.0',
'djangorestframework<=3.3.3',
'django-filter>=0.15.3',
'djangorestframework<=3.5.3',
'django-filter==1.0.0',
'pytz==2016.4',
'future>=0.15.2',
],
Expand Down

0 comments on commit a95e211

Please sign in to comment.