Questions tagged [django-datatable]

django-datatables-view is a base view for handling server side processing for the awesome datatables. django-datatables-view simplifies handling of sorting, filtering and creating JSON output.

django-datatables-view is a base view for handling server side processing for the awesome datatables found here.

django-datatables-view simplifies handling of sorting, filtering and creating JSON output, as defined here.

47 questions
1
vote
1 answer

django-rest-framework-datatables and Django Parler's translation field

I've got model with translated fields. class Device(TranslatableModel): translations = TranslatedFields(name=models.CharField(max_length=100)) I made a serializer like: class DeviceSerializer(TranslatableModelSerializer): translations =…
1
vote
3 answers

Data table not populating data in django-datatable-view

I've started a new Django project with trying to test out django-datatable-view. I'm getting a JS error saying Uncaught TypeError: $$.each is not a function. Although following the code on the library's website jQuery is being loaded before…
user1014691
  • 79
  • 1
  • 9
1
vote
2 answers

Define Filter on django-datatable-view

I am using django-datatable-view to show my data. I have a scenario that I need to retrieve records from a model, that satisfy certain conditions. For example, the request could be described as: "SELECT * FROM model WHERE column_1='value_1' AND…
snoba
  • 153
  • 3
  • 8
1
vote
0 answers

Slicing in django datatables

class OrderConsentsEnterpriseJson(BaseDatatableView): model = CONSENTS columns = ['iConsentID','iMSISDN','iCommID','iPurpose'] order_columns = ['iConsentID','iMSISDN','iCommID','iPurpose'] def get_initial_queryset(self): …
1
vote
1 answer

add link or any html tag to column in django-datatables-view

I've got django-datatables-view looking like this: class OrderListJson(BaseDatatableView): model = Flat columns = ['id', 'flat_price', 'flat_house.house_block.block_name'] order_columns = ['flat_price',…
mailman_73
  • 778
  • 12
  • 29
1
vote
2 answers

Django - Datatables with Rest Framework

I am using this library for datatables in django-rest. Everything is working fine expect request.user session in views. It seems to me django-datatable is not authenticating the user token and therefore request.user returns anonymous user. And the…
user5594493
  • 1,050
  • 3
  • 10
  • 24
1
vote
0 answers

django-datatables-view not displaying content returned from AJAX request?

My Ajax request to update the tables is not working. Attached is the screenshot. It simply displays "processing" but nothing happens. The JSON object that is returned (if i visit the URL -{% url 'search_list_json' %} --used in AjaxSource of Js code…
brain storm
  • 30,124
  • 69
  • 225
  • 393
0
votes
1 answer

Autofill Timestamps in Django Model

I want to create two fields for creating an object in Django models. The first field is required and will use the built in DateTimeField. Second field will take on the same data as in the first field, furthermore it should be possible to update the…
atp55
  • 11
  • 3
0
votes
0 answers

Data is not saved to model User

I created a class to update user information, but the information is not saved. Can you help me find the code problem? I created a class called ProfileUpdateView that overrides LoginRequiredMixin and View. When I change the profile information, I am…
0
votes
0 answers

How to import a .sql file file into Django models and query it

I have a single file with data in it with a .sql extension. I want to be able to query it and display results using Django Templates and Views. How do I even access it in my Django Project. Anyone please I have tried to create a server for the file…
0
votes
0 answers

Search custom form with post request datatable not working

Hello everyone can i search with post request in datatables? backend -> django frontend -> html/css jquery In backed django I'm using the django_serverside_datatable library for populating data. Please guide me. I see in datatables no option for…
Kashif
  • 1,364
  • 17
  • 21
0
votes
1 answer

Django datatables view Related Field got invalid lookup: istartswith

I am trying to render a datatable using django datatables view, but it always gives this error when I try to search, django.core.exceptions.FieldError: Related Field got invalid lookup: istartswith. The model I am using has a ForeignKey to another…
David.B
  • 370
  • 6
  • 16
0
votes
1 answer

Django Datatables View filter/search

Using django-datatable-view at https://github.com/pivotal-energy-solutions/django-datatable-view for a class based DataTable. It is all working and loading but i have the issue with searching data. I cannot work out how to search for the whole…
Spirconi
  • 164
  • 1
  • 12
0
votes
2 answers

How to query related object in DRF viewsets.ModelViewSet

I have a serialised model (Job) which I am using with datatables. The "Job" model is related to another model (Board) and here is where my problem is. I followed the doc here to filter jobs that are related to the "Board" model which is currently…
0
votes
1 answer

Django Datatables taking too long to load

I am trying to load 25600 rows into datatables but it's taking around 10 seconds. The request is via an ajax API call. views.py @api_view() def get_all_data(request): get_all_data_ =…