开发者

Listing data in django admin that not stored in database (and not used standard models for that reason)

开发者 https://www.devze.com 2023-01-26 03:18 出处:网络
I got a situation when some part of data stored in database so there is no problems to handle it with django admin. But some data stored in few fi开发者_运维百科les on filesystem and i need to parse a

I got a situation when some part of data stored in database so there is no problems to handle it with django admin. But some data stored in few fi开发者_运维百科les on filesystem and i need to parse and show them (no need to have all CRUD operations here, only listing)

I have a way to build custom admin but i prefer to do that with standard django admin. So is there any way where i can list data in django admin that stored not in database?


Taking some inspiraton from Eric Holscher's recent post, you could create a model just to keep track of some metadata for the files, and use that to list the files in the admin.

class ImportedFile(models.Model):
    name = models.CharField(max_length=255)
    path = models.CharField(max_length=255)
0

精彩评论

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