DEV Community

loading...

Discussion on: Creating Django models of an existing DB

Collapse
meowwings profile image
MeowWings • Edited

I just get the attached few lines.

This is an auto-generated Django model module.

You'll have to do the following manually to clean this up:

* Rearrange models' order

* Make sure each model has one field with primary_key=True

* Make sure each ForeignKey has on_delete set to the desired behavior.

* Remove managed = False lines if you wish to allow Django to create, modify, and delete the table

Feel free to rename the models, but don't rename db_table values or field names.

from django.db import models

I tried both schema and dbo

Pls help