forked from DGNum/gestioCOF
use the new django app loading system
This commit is contained in:
parent
e9536c17ba
commit
3b1e70f70c
1 changed files with 2 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
import csv
|
import csv
|
||||||
from django.http import HttpResponse, HttpResponseForbidden
|
from django.http import HttpResponse, HttpResponseForbidden
|
||||||
from django.template.defaultfilters import slugify
|
from django.template.defaultfilters import slugify
|
||||||
from django.db.models.loading import get_model
|
from django.apps import apps
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
|
|
||||||
def export(qs, fields=None):
|
def export(qs, fields=None):
|
||||||
|
@ -38,7 +38,7 @@ def admin_list_export(request, model_name, app_label, queryset=None, fields=None
|
||||||
if not request.user.is_staff:
|
if not request.user.is_staff:
|
||||||
return HttpResponseForbidden()
|
return HttpResponseForbidden()
|
||||||
if not queryset:
|
if not queryset:
|
||||||
model = get_model(app_label, model_name)
|
model = apps.get_model(app_label, model_name)
|
||||||
queryset = model.objects.all()
|
queryset = model.objects.all()
|
||||||
filters = dict()
|
filters = dict()
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue