开发者

Django web interface components

开发者 https://www.devze.com 2023-01-17 15:05 出处:网络
I am using python and django and like it a lot. But than i use it, I catch myself thinking what i do a lot of work to render result data and write specific actions for it. For example than i pass resu

I am using python and django and like it a lot. But than i use it, I catch myself thinking what i do a lot of work to render result data and write specific actions for it. For example than i pass result set of objects to template i must render all data and write all possible actions such as sorting by columns,filtering,deletion,edit etc, for each of this i need to write code in urls.py and views.py, sometimes helps generic view but it's has poor functions. Is there some solutions to automate this work? i mean use some interface compontents (such as "model list renderer with column filter and pagination") to wich i need only "bind my model", all other routing work for drawing common interface action must be allready implemented in these com开发者_StackOverflow社区ponents. i think i need something like configurable components for fast building html web interface for models (such as model forms do fast generation forms for models). What do you think can help in this case?


must render all data and write all possible actions such as sorting by columns,filtering,deletion,edit etc

Like django.contrib.admin? But I guess it's way to complicated and bloated for your needs.

sometimes helps generic view but it's has poor functions

And that's the way, I think, you should be going. If you write same views over and over again, just make your own generic views. As an example of more robust views and a source of inspiration I recommend you to look at class-based generic views.

Also consider using model inheritance and custom managers.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号