-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
I created tables with these definitions:
class ElementsTable(Table, tablename="meta_elements", schema=AppConfig.DB_SCHEMA):
classification_code = ForeignKey(
references=tables.ClassificationsTable,
target_column=tables.ClassificationsTable.code,
on_delete=OnDelete.cascade,
on_update=OnUpdate.cascade,
default=None,
required=True,
null=False
)
class ClassificationsTable(Table, tablename="meta_classifications", schema=AppConfig.DB_SCHEMA):
code = Varchar(
length=40,
unique=True,
required=True,
null=False
)
# other columns omitted due to irrelevance
In piccolo-admin web GUI, I attempted to insert a value from the referenced target
column into the classification_code
column of the meta_elements
table.
The admin GUI has hardcoded expectation that ForeignKeys only reference the ID column of referred tables
and it does not even allow me to manually type a value for the classification_code
column.
The constraint itself is created correctly in the Postgres database:
These inconsistencies between the components make ForeignKeys unusable together with Piccolo-Admin.
Please put more effort into checking the quality and coherence of your source code.
Metadata
Metadata
Assignees
Labels
No labels