P
P
Prog2019-02-14 11:26:50
Django
Prog, 2019-02-14 11:26:50

How to change the model field name correctly?

Let's say there is a model

class MyModel(models.Model):
    id = models.AutoField(primary_key=True)
    date = models.DateTimeField(auto_now=True)

How to rename the date field correctly, for example, to MyDate ?
Given that the data is already in the database.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question