Added
- Python 3.11 support
Changed
- :class:
sheraf.queryset.QuerySet
order performance optimizations.
Added
- :class:
sheraf.exceptions.TooManyValuesSetUnpackException
Changed
- Improved :class:
sheraf.queryset.QuerySet
exceptions error messages.
Added
- :class:
sheraf.queryset.QuerySet
model attribute is kept when bitwise operator is used.
Added
- :class:
~sheraf.attributes.collections.SetAttribute
handles minus operator
Changed
- support for rich > 10
- index performances improvements
Changed
- delayed some imports
Changed
- The context manager
connection
always closes the connection :pr:26
- health functions are not imported by default anymore.
Added
- :class:
~sheraf.types.largelist.LargeList
supports item deletion.
Added
- :class:
~sheraf.attributes.collections.ListAttribute
supports item deletion.
Changed
- Do not catch model deletion errors when model creation fails.
Added
- Implemented :meth:
sheraf.attributes.enum.EnumAttribute.__repr__
- Ended support for python 3.6
- Implemented :meth:
sheraf.models.indexation.BaseIndexedModel.__str__
, - Implemented :meth:
sheraf.models.indexation.BaseIndexedModel.on_creation
and :meth:sheraf.models.indexation.BaseIndexedModel.on_deletion
callbacks. - :class:
~sheraf.attributes.models.IndexedModelAttribute
indexation.
Fixed
- Fixed :meth:
~sheraf.attributes.models.IndexedModelAttribute.read
exceptions on bad IDs
Fixed
- :meth:
~sheraf.models.base.BaseModel.assign
calls with :class:~sheraf.attributes.models.ModelAttribute
that have several model class types, again.
Fixed
- :meth:
~sheraf.models.base.BaseModel.assign
calls with :class:~sheraf.attributes.models.ModelAttribute
that have several model class types.
Added
__repr__
for :mod:~sheraf.attributes.collections
attributes.
Added
- :meth:
sheraf.cli.rebuild
have a--fork
option to compute each batch in a separate process.
Fixed
- Another :meth:
~sheraf.attributes.collections.SetAttribute.update
error with models.
Fixed
- Another :meth:
~sheraf.attributes.collections.SetAttribute.update
error with models.
Fixed
- :meth:
~sheraf.attributes.collections.SetAttribute.update
error with models.
Fixed
- An error when several indexes exists on several common attributes,
and one of them is unique, and a :class:
~sheraf.exceptions.UniqueIndexException
is raised.
Fixed
- :meth:
~sheraf.attributes.collections.SetAttribute.update
error.
Added
- :meth:
sheraf.cli.rebuild
have two options--batch-size
that sets the number of elements to iterate between two savepoints, and--commit
that replaces savepoints by real transaction commits. - :class:
~sheraf.attributes.index.Index
has aauto
parameter, that can disable the automatic use of the index.
Changed
- :meth:
sheraf.cli.rebuild
now have a progress bar. - Bugfix on :meth:
sheraf.models.indexation.BaseIndexedModel.index_table_rebuild
arguments are passed with*args
.
Fixed
- Bugfix on :meth:
sheraf.models.indexation.BaseIndexedModel.all
.
Added
- :meth:
sheraf.models.indexation.BaseIndexedModel.all
can take an index as argument.
Added
- Implemented :meth:
~sheraf.attributes.Attribute.on_change
as a shortcut for :meth:~sheraf.attributes.Attribute.on_creation
, :meth:~sheraf.attributes.Attribute.on_edition
, and :meth:~sheraf.attributes.Attribute.on_deletion
.
Changed
- :func:
~sheraf.transactions.attempt
opens a connection if needed.
Changed
- Index related 'values' methods and parameters have been renamed 'index_keys'
- Index related 'search' methods and parameters have been renamed 'search_keys'
- Implemented Attribute :meth:
~sheraf.attributes.Attribute.index_keys_func
and :meth:~sheraf.attributes.Attribute.search_keys_func
.
Added
- :meth:
sheraf.models.indexation.BaseIndexedModel.search_keys
, :meth:sheraf.models.indexation.BaseIndexedModel.index_keys
and :meth:sheraf.models.indexation.BaseIndexedModel.is_indexed_with
.
Changed
- :class:
~sheraf.databases.Database
use :class:contextvars.ContextVar
instead of :class:threading.local
.
Fixed
- Fixed :class:
sheraf.queryset.QuerySet
concatenation when QuerySet is copied.
Added
- :func:
sheraf.health.utils.import_models
can take a model path. - Implemented :meth:
~sheraf.attributes.Attribute.default
decorator. - :class:
sheraf.queryset.QuerySet
supports concatenation
Added
- A :func:
~sheraf.cli.rebuild
that allows to rebuild an index from the command line. - :class:
~sheraf.attributes.enum.EnumAttribute
supports comparisons.
Changed
- :class:
~sheraf.models.indexmanager.IndexManager
uses :class:~BTrees.OOBTree.OOBTree
to store multiple indexes.
Changed
- Primary indexes are not editable.
Fixed
- :class:
~sheraf.attributes.collections.SetAttribute
update method now casts the input value.
Added
- :class:
~sheraf.attributes.models.ReverseModelAttribute
can support :class:~sheraf.attributes.collections.SetAttribute
.
Added
- :class:
~sheraf.attributes.models.ModelAttribute
can take a relative model path. - :meth:
~sheraf.attributes.index.Index.values
can return unique object instead of collections. :issue:33
- Implemented :meth:
~sheraf.attributes.Attribute.on_creation
, :meth:~sheraf.attributes.Attribute.on_edition
, and :meth:~sheraf.attributes.Attribute.on_deletion
callbacks. :issue:40
Changed
- :meth:
sheraf.queryset.QuerySet.__getitem__
does not return a list anymore when one single value is accessed. - :meth:
sheraf.queryset.QuerySet.count
does not consume the QuerySet.
Removed
- :class:
~sheraf.attributes.BaseAttribute
Changed
- :meth:
sheraf.queryset.QuerySet.__bool__
does not consume the QuerySet.
Added
- Implemented :meth:
sheraf.queryset.QuerySet.__bool__
:issue:41
- Improved :meth:
sheraf.queryset.QuerySet.__repr__
:issue:31
- Implemented :meth:
sheraf.queryset.QuerySet.__len__
Changed
- :class:
~sheraf.attributes.password.PasswordAttribute
comparision and encryption functions can be overloaded. :issue:39
Changed
- Better error message for invalid
:meth:
sheraf.types.largelist.LargeList.__getattr__
keys.
Fixed
- Fixed a bug with :meth:
~sheraf.models.base.BaseModel.assign
and :class:~sheraf.attributes.models.ModelAttribute
when passed model ids.
Added
- :class:
~sheraf.attributes.models.ReverseModelAttribute
can be assigned model ids.
Changed
- Refactored :class:
~sheraf.queryset.QuerySet
and removed slicing on negative values.
Changed
- Refactored :class:
~sheraf.queryset.QuerySet
and removed a bit of the last commit to allow QuerySets to stay lazy.
Changed
- Refactored :class:
~sheraf.queryset.QuerySet
and improved performance for search calls based on several indexes.
Fixed
- Fixed a bug with :class:
~sheraf.attributes.enum.EnumAttribute
string casting.
Fixed
- Fixed a bug with :class:
~sheraf.attributes.enum.EnumAttribute
equality.
Fixed
- Fixed :class:
~sheraf.attributes.enum.EnumAttribute
can handle :class:None
values.
Fixed
- Fixed :class:
~sheraf.attributes.enum.EnumAttribute
hashability.
Fixed
- Fixed :class:
~sheraf.attributes.enum.EnumAttribute
casting.
Added
- Implemented :class:
~sheraf.attributes.enum.EnumAttribute
.
Added
- Implemented :class:
~sheraf.attributes.models.ReverseModelAttribute
. :issue:35
Fixed
- QuerySet :meth:
~sheraf.queryset.QuerySet.count
shortcuts do transform input values.
Added
- Model :meth:
~sheraf.models.indexation.IndexedModel.count
method can take an index name as a parameter. - QuerySet :meth:
~sheraf.queryset.QuerySet.count
method is far more quicker when there is only one indexed filter.
Added
- Implemented :class:
~sheraf.attributes.password.PasswordAttribute
. :issue:5
Added
- :meth:
~sheraf.attributes.index.Index.values
is given the attributes values in positional argument if it is assigned to one or several attributes.
Changed
- BaseAttribute renamed in :class:
~sheraf.attributes.Attribute
.
Fixed
- :class:
~sheraf.attributes.index.Index
inheritance is fixed. - :class:
~sheraf.attributes.index.Index
update :class:~sheraf.attributes.Attribute
on deletion. - :meth:
~sheraf.databases.connection
can take areuse
parameter.
Added
- :class:
~sheraf.attributes.index.Index
can be used directly as :meth:~sheraf.models.indexation.IndexedModel
parameters. :pr:11
- :meth:
sheraf.types.largelist.LargeList.remove
can take aall
argument. - :meth:
sheraf.types.largelist.LargeList.append
can take aunique
argument. - :class:
~sheraf.attributes.index.Index
can have several :class:~sheraf.attributes.Attribute
:issue:23
Changed
batches
have been renamedhealth
Fixed
- Fixed a bug happening when creating a :meth:
~sheraf.models.indexation.IndexedModel
with an indexed :class:~sheraf.attributes.models.ModelAttribute
not initialized at creation.
Added
- :class:
~sheraf.attributes.index.Index
have anullok
parameter,True
by default, that allows indexation of falseworthy values. :issue:16
Changed
- Checks and migrations now use rich. :issue:
12
Fixed
- Fixed a bug with indexed :class:
~sheraf.attributes.simples.IntegerAttribute
.
Added
- :func:
~sheraf.transactions.commit
can take no argument. - :meth:
~sheraf.models.base.BaseModel.edit
has astrict
parameter. :issue:18
Added
- :class:
~sheraf.attributes.blobs.BlobAttribute
shortcut for common web frameworks.
Added
- :class:
~sheraf.attributes.simples.TypeAttribute
can haveNone
values.
Added
- :class:
~sheraf.attributes.index.Index
have anoneok
parameter,False
by default, that allows indexation ofNone
values. :issue:16
Changed
- Fixed indexation of generic :class:
~sheraf.attributes.models.ModelAttribute
.
Added
- :class:
~sheraf.attributes.Attribute
can have custom :meth:~sheraf.attributes.Attribute.values
and :meth:~sheraf.attributes.Attribute.methods
that will be used by default if :meth:~sheraf.attributes.Attribute.index
values_func
andsearch_func
are not provided. - Indexation is possible by default with :class:
~sheraf.attributes.collections.ListAttribute
and :class:~sheraf.attributes.collections.SetAttribute
. :issue:11
- Indexation is possible by default with :class:
~sheraf.attributes.models.ModelAttribute
. :issue:10
- :class:
~sheraf.attributes.models.ModelAttribute
can have several model classes. :issue:13
Changed
- Use
~BTrees.OOBTree.OOTreeSet
instead of~orderedset.OrderedSet
. - :class:
~tests.AutoModel
has moved in the tests directory.
Removed
- :class:
~sheraf.attributes.files.FileObjectV1
has been removed.
Changed
- Fixed a bug when setting an indexed value after the object creation. :pr:
9
- Fixed :class:
~sheraf.types.SmallDict
conflict resolution.
Removed
- Python 3.5 support
Deprecated
- :class:
~sheraf.attributes.files.FileObjectV1
is deprecated and will be removed in sheraf0.3.0
. - :class:
~sheraf.models.AutoModel
are deprecated and will not be shipped with sheraf0.3.0
. However, they will still be available for development with sheraf tests.
Added
A whole indexation mechanism. :pr:1
- A new :class:
~sheraf.attributes.models.IndexedModelAttribute
attribute, that holds a whole model indexation table. - A new :class:
~shera.models.AttributeMode
l class, to be used with :class:~sheraf.attributes.models.IndexedModelAttribute
. - Method :meth:
~sheraf.attributes.Attribute.index
method on :class:~sheraf.attributes.Attribute
to describe indexes. - Two check methods :func:
sheraf.batches.checks.check_attributes_index
and :func:sheraf.batches.checks.check_model_index
to check the index tables integrity. - Method :meth:
~sheraf.models.indexation.BaseIndexedModel.index_table_rebuild
to rebuild an index table. - filter and order methods on QuerySet are faster on indexed attributes.
Removed
- :func:
sheraf.models.BaseIndexedAttribute.make_id
- :class:
~sheraf.indexes.Index
- :class:
~sheral.attributes.BaseIndexedAttribute
lazy_creation parameter has been renamed lazy.
Changed
- Fixed a bug when setting an indexed value after the object creation. :pr:
9
Deprecated
- :func:
sheraf.models.BaseIndexedAttribute.make_id
. Please use the 'default' parameter of your id :class:~sheraf.attributes.Attribute
instead. - :class:
~sheraf.indexes.Index
- :class:
~sheral.attributes.BaseIndexedAttribute
lazy_creation parameter has been deprecated, and has been renamed lazy.
Added
- :class:
sheraf.attributes.collections.SmallDictAttribute
.
- First version.