frostyx / copr / copr

Forked from copr/copr 7 years ago
Clone

ff82f0a [frontend] simplify *_private tables

Authored and Committed by praiskup 5 years ago
    [frontend] simplify *_private tables
    
    It is possible to use "non-standard mapping" [1] for combining two
    tables (user+user_private or copr+copr_private) into a single
    model.  This way we are not required to change any *_logic.py,
    or otherwise reflect the model change.
    
    The only caveat is that we need to define the relationships in the
    combined model (e.g. Copr), while referencing the foreign keys
    from child model (e.g. from CoprPublic).
    
    [1] https://docs.sqlalchemy.org/en/latest/orm/nonstandard_mappin\
    gs.html#mapping-a-class-against-multiple-tables