- Add
py.typed
for typing support - Improve type hints
- Drop
BaseQuery
in favor of directly using upstreamsqlalchemy.orm.Query
- format code with
black
- bump minimum required Python version to 3.10+
- compatible with SQLAlchemy versions 1.3.x and 1.4.x
- convert to
pyproject.toml
- add
rec_getattr
andrec_hasattr
functions for recursive attribute access - add support for recursive getattr in automatic
Model.__repr__
- add
str
Meta option for automaticModel.__str__
- fix bug with automatic index name for
index_together
- update from m2r to m2rr for docs
- add
unique_together
Meta option for models - add
index_together
Meta option for models - add
relationships
Meta option for models (moved from Flask Unchained)
- fix compatability with SQLAlchemy 1.4
- make
ModelRegistry
and other protected internal classes public
- support passing
ondelete
andonupdate
keyword arguments to theforeign_key
helper function
Breaking Changes
- removed the
__getattr__
magic method fromSessionManager
- fix tests for
ModelManager.filter
andModelManager.filter_by
- drop support for Python 3.5
- return
BaseQuery
fromModelManager.filter
andModelManager.filter_by
- make the default timestamp
created_at
andupdated_at
columns not-nullable - disable automatically adding the
Required
validator to model fields - pass
McsInitArgs
toModelRegistry.should_initialize
instead of just the model class name
- make
BaseModel.validate
a normal method, default to non-partial validation - add
BaseModel.validate_values
as a classmethod - fix tests
- fix BaseModel constructor to only perform partial validation
- bump required
alembic
version to 1.0.9 (fixesimmutabledict is not defined
error)
- bump required
alembic
andpy-meta-utils
versions
- fix
ModelManager.get_or_create
andModelManager.update_or_create
- disable
autoflush
forModelManager.get_or_create
andModelManager.update_or_create
- fix project name on PyPI having spaces
- breaking: change signature of
ModelManager.get_or_create
to take adefaults
parameter - add
ModelManager.update_or_create
- do not add a primary key column if the user defined a custom primary key constraint in
__table_args__
- update default naming convention for foreign keys to be more human readable
- improve support for non-integer primary keys
- add support for setting the transaction
isolation_level
of the db engine
- the primary key meta option now checks if the model already has a user-declared primary key column, and if so, it will not add another itself
- rename
_SessionMetaclass
to_SessionManagerMetaclass
- require py-meta-utils v0.7.3
- fix automatic required validator to not be applied to foreign key columns
- fix
declarative_base
so that it correctly determines whether or not to use the passed in model's constructor
- removed the factory_boy fix added in v0.6.3 because it really belongs in flask unchained
- fix the
ModelRegistry.reset
method so it allows using factory_boy fromconftest.py
- require alembic 1.0.1, py-meta-utils 0.7.2, and sqlalchemy 1.2.12
- update
BaseQuery.get
so that tuple identifiers get converted toint
as well - add
ModelManager.get
query method - add
SessionManager.delete
andSessionManager.delete_all
methods
- require py-meta-utils 0.7.0
- fix SessionManager tests
- documentation improvements
- rename
DB_URI
toDATABASE_URI
- rename the
db_uri
argument ofinit_sqlalchemy_unchained
todatabase_uri
- remove the
ModelMetaOptionsFactory._model_repr
property - remove the
validates
decorator - discourage the use of Active Record anti-patterns (remove
query
attribute fromBaseModel
) - add
SessionManager
andModelManager
to encourage use of Data Mapper patterns - add
query_cls
keyword argument toinit_sqlalchemy_unchained
andscoped_session_factory
- bugfix for
declarative_base
if a custom base model is passed in without a constructor - configure the
MetaData
naming convention if none is provided
- bugfix: cannot automatically determine if relationship/association_proxy attributes should be required
- configure tox & travis
- make compatible with Python 3.5
- fix
ReprMetaOption
to pull default primary key name fromModelRegistry()
ColumnMetaOption
values should only bestr
orNone
- bump required
py-meta-utils
to v0.6.1 ColumnMetaOption.check_value
should raiseTypeError
orValueError
, notAssertionError
- Move declaration of factory meta options from
ModelMetaOptionsFactory._get_meta_options()
toModelMetaOptionsFactory._options
- bugfix: use correct foreign key for the primary key on joined polymorphic models
- publish documentation on read the docs
- fix automatic required validators
- rename
ModelRegistry
to_ModelRegistry
- set default primary key as a class attribute on the
ModelRegistry
- update to py-meta-utils 0.3
- update to py-meta-utils 0.2
- fix automatic Required validation (should not raise if the column has a default value)
- implement validation for models
- wrap
sqlalchemy.orm.relationship
with the configuredQuery
class - override the
alembic
command to customize the generated migrations templates - export
ColumnMetaOption
from the top-levelsqlalchemy_unchained
package - export
association_proxy
,declared_attr
,hybrid_method
, andhybrid_property
from the top-levelsqlalchemy_unchained
package - add documentation
- add tests
- initial release