Skip to content

Many to one reverse fk support #3

@tdaron

Description

@tdaron

Hi ! I tried using oxyde-admin but got stuck with this schema:

from oxyde import Model, Field


class Team(Model):
    id: int | None = Field(default=None, db_pk=True)
    users: list["User"] = Field(db_reverse_fk="team")
    name: str
    evolution_address: bool = Field(default=False)
    evolution_name: bool = Field(default=False)
    evolution_studies: bool = Field(default=False)
    evolution_contract_change: bool = Field(default=False)
    class Meta:
        is_table = True
    
class User(Model):
    id: int | None = Field(default=None, db_pk=True)
    name: str
    email: str = Field(db_unique=True)
    age: int | None = Field(default=None)
    team: Team = Field(default=None, db_on_delete="CASCADE")

    class Meta:
        is_table = True

The users field on the Team class makes the UI crash. Is there any quick fix I could do ?
Thanks for your work on oxyde, this interface looks really promising :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions