Skip to content

Relations are not checked or ignored. #53

@Slluxx

Description

@Slluxx

When building relaton like this

class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True, autoincrement=True)
    name= Column(String)

    items = relationship("Item", back_populates="user", cascade="all, delete-orphan")

class Item(Base):
    __tablename__ = 'items'
    id = Column(Integer, primary_key=True, autoincrement=True)
    dbUserId = Column(Integer, ForeignKey("users.id"))
    name = Column(String)

    user = relationship("User", back_populates="items")

They are ignored/unused/unchecked in crudadmin. For example

  1. I can create items of users that do not exist.
  2. There is no "helper" that shows me users when i type a userid (or any other, like name) to create an item for.
  3. There is no link of item to user in the interface (i can't click the userid to go to the user and vice-versa)
  4. When a user is deleted, their items are not deleted.

To be completely honest, i think 4 is a me-problem. I am not sure if sqlite really supports this (although it seems that SQLAlchemy should support something like this on the ORM level).

These proposals are mostly just UX related but i feel like they would elevate crudadmin and make it a more solid tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions