X
X
Xamber2014-08-07 13:09:09
Django
Xamber, 2014-08-07 13:09:09

How to check models.py for matching fields to base fields?

Good afternoon.
I work with a database that another person makes, and communication with him is quite rare.
He can change the name of a column in the database, add a table, change the name of a table, and so on.
You could just change the current models.py file and the generated models file, but there are a lot of methods in the classes and so on.
Is there any library or way to do automatic check for changes?
You can check new tables if you compare models.py and the file obtained by sorting through the
python manage.py inspectdb > db.py
classes.
And how to check fields and properties, for example max_length=250 ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2014-08-08
@syschel

If he makes a change in a python file (models.py), then any version control system (git, svn, hg, ...) can be used. And then just watch the changes in the repository. Even if this person does not himself make changes to the repository, you do it by executing the command to check for changed files. You will see changes to the symbol (what was replaced, what was deleted, what was added to the code).
KsR3gdC.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question