• Florian Sachs's avatar
    Reuseable functions for handling of inherited pks · 1e8520da
    Florian Sachs authored
    Two new functions on `contrib.sql.tools`:
    
      - `is_inherited_primary_key(prop)` : Returns True if the `ColumnProperty` **prop** is an inherited primary key. Occuring Exceptions are not handled but raised. *Should* work with arbitrary levels of inheritance.
      - `get_column_for_current_model(prop)` : Return the `Column` that belongs to the model of the `ColumnProperty` **prop**. So if the ColumnProperty is for the parent, the Column for the parent ist returned. If the ColumnProperty if for the Child, the Column for the child is returned. Works with arbitrary levels of inheritance.
    
    `AdminModelConverter.convert()`  and `ModelView.scaffold_list_columns()` are adapted to use the new functions.
    1e8520da
Name
Last commit
Last update
..
contrib Loading commit data...
form Loading commit data...
model Loading commit data...
static Loading commit data...
templates/admin Loading commit data...
tests Loading commit data...
translations Loading commit data...
__init__.py Loading commit data...
_backwards.py Loading commit data...
_compat.py Loading commit data...
actions.py Loading commit data...
babel.py Loading commit data...
base.py Loading commit data...
helpers.py Loading commit data...
tools.py Loading commit data...