Django Dynamic DataTables – Free Tool (Updated)

django-dynamic-datatables-–-free-tool-(updated)

Hello Coders!

This article presents an open-source tool that builds server-side paginated DataTables with minimum effort. The input expected by the Dynamic DataTables module is the model definition plus a single line in the configuration. Sources are published on GitHub and the permissive (MIT) license allows the incorporation in commercial projects or use for eLearning activities. Thanks for reading!

DevTool Highlights

Data pagination can be useful in many use cases like management and interaction with registered users of a popular app, students of a class, etc. For all those cases, this tool might be helpful.

Here are the features provided on top of every model defined in our Django project, without any coding effort:

  • ✅ Manages the data for any model
  • One-line configuration
  • Server-side pagination
  • Search, Data Filters
  • Exports in PDF, CSV formats

Quick Start in Docker

The tool is pre-configured to enable the Dynamic DataTables UI for a simple Books model. Once the project is downloaded and started we should be able to interact with the UI without any efforts.

👉 Step 1 – Download the code from GitHub

$ git clone https://github.com/app-generator/devtool-django-dynamic-datatb.git
$ cd devtool-django-dynamic-datatb

👉 Step 2 – Start the APP in Docker

$ docker-compose up --build

At this point, we can visit the app in the browser. The dynamic view is live at http://localhost:5085/datatb/books.

Django Dynamic DataTables - Open-Source tool for developers (GIF nimated presentation).

How it works

The tool builds a generic layout on top of each model defined in the project and enabled in the configuration.

To showcase the tool, sources are shipped with a working sample for the Books model – Here are the relevant parts:

👉 (1) Books Model Definition – in apps/models.py file

class Book(models.Model): 
    title = models.CharField(max_length=100)

👉 (2) Configuration for Books model

DYNAMIC_DATATB = {
    'books': "Book",
}

The pattern used in this Python DICT is to use the URL segment as key and Model as the entity to be processed.

So, the above settings enable the Dynamic DataTB for Books model using url: http://localhost:8000/datatb/books

Video Presentation

A full demonstration of this feature can be found on YouTube:

Next Steps

The roadmap of the product includes the following evolutions:

  • ✅ Bulk Data Provisioning (drop zone)
  • ✅ Independent module installation via PIP
  • ✅ Styling Option: Tailwind or BS5
    • Note: currently only BS5 is supported.

Thanks for reading! For more resources, feel free to access:

Django API Generator

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post
i-got-my-hacktoberfest2022-badge-

I got my Hacktoberfest2022 Badge 🎉

Next Post
hacktoberfest-2022-t-shirt

Hacktoberfest 2022 t-shirt

Related Posts
5章5

5章5

このJavaコードのスニペットには、ItemクラスとMainクラスの2つのクラスが含まれています。ItemクラスにはnameというString型の変数とpriceというint型の変数があり、priceは100に初期化されています。 Mainクラスにはmainメソッドがあり、ここでプログラムが実行されます。mainメソッドはItemオブジェクトの配列itemsを作成し、その長さを3に設定します。その後、整数型の変数totalを0で初期化し、forループを使用して各Itemオブジェクトのpriceをtotalに加算します。 しかし、このコードにはItemオブジェクトを実際にitems配列に割り当てるコードがありません。つまり、items配列にはデフォルトでnullが設定されているため、Itemのインスタンスが存在せず、items[i].priceを参照しようとするとNullPointerExceptionが発生します。 そのため、選択肢E「実行時に例外がスローされる」という答えが正しいです。Itemオブジェクトがitems配列に割り当てられていないため、forループの実行時にnullのpriceにアクセスしようとして例外がスローされます。 コードにコメントを加えて説明すると以下のようになります: public class Item { String name; // 商品名を保存する変数 int price = 100; //…
Read More