I started organizing my models in a package as specified here : https://docs.djangoproject.com/en/1.11/topics/db/models/#organizing-models-in-a-package
I'm using a legacy Oracle database
I also created a module containing some extensions/inheritances of the Model class, to facilitate creating multiple classes that contain repeated fields
This is my structure :
models/
__init__.py
geo_classes.py
tables.py
The error is the following :
django.db.utils.DatabaseError: ORA-00904: "TABLE_NAME"."TABLECLASS_PTR_ID": invalid identifier
I couldn't find anything online about this PTR_ID it is trying to catch, maybe I missed something about extending base Models?
Files (only the important parts) :
geo_classes.py :
from django.db import models
class EsriTable(models.Model):
objectid = models.BigIntegerField(unique=True, editable=False, verbose_name='OBJECTID')
class TableClass(EsriTable):
cod = models.BigIntegerField(primary_key=True)
def __str__(self):
return str(self.cod)
tables.py :
from .geo_classes import TableClass
from django.db import models
class MyClass(TableClass):
#Fields
name = models.CharField(max_length=50)
#Keys
#Relations
class Meta:
managed = False
db_table = 'TABLE_NAME'