• 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
babel Loading commit data...
doc Loading commit data...
examples Loading commit data...
flask_admin Loading commit data...
.gitignore Loading commit data...
.gitmodules Loading commit data...
.travis.yml Loading commit data...
AUTHORS Loading commit data...
LICENSE Loading commit data...
MANIFEST.in Loading commit data...
Makefile Loading commit data...
NOTICE Loading commit data...
README.rst Loading commit data...
TODO.txt Loading commit data...
projects.rst Loading commit data...
requirements.txt Loading commit data...
setup.cfg Loading commit data...
setup.py Loading commit data...