D
D
dr sbtn2016-05-12 14:46:03
Django
dr sbtn, 2016-05-12 14:46:03

How to rename objects while administering django?

Using pycharm (and built-in server and SQLite), I open my models on the django admin page. For example, there are tables USER and ROLE (each user will have a certain role - admin, moderator, ...)
Having created several examples of users and roles, I tried to make matches for them. But the problem is that it all looks like a role object and user object (opening them, I see the data that I entered there).
can this be renamed somehow or how to deal with this problem?c6fb0203323e4ef08d8e2358831bb88a.PNG
1dede05739ce4131a2924bbcdce0877c.PNG

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2016-05-12
@dawasaturday

You need to define the __str__ method in the models .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question