add release docs, change tests

This commit is contained in:
collerek
2021-03-15 13:00:07 +01:00
parent 5c633d32a8
commit 03e6ac6c02
10 changed files with 115 additions and 19 deletions

View File

@ -51,8 +51,8 @@ def populate_default_options_values(
new_model.Meta.model_fields = model_fields
if not hasattr(new_model.Meta, "abstract"):
new_model.Meta.abstract = False
if not hasattr(new_model.Meta, "order_by"):
new_model.Meta.order_by = []
if not hasattr(new_model.Meta, "orders_by"):
new_model.Meta.orders_by = []
if any(
is_field_an_forward_ref(field) for field in new_model.Meta.model_fields.values()

View File

@ -252,9 +252,9 @@ def populate_meta_tablename_columns_and_pk(
new_model.Meta.columns = columns
new_model.Meta.pkname = pkname
if not new_model.Meta.order_by:
if not new_model.Meta.orders_by:
# by default we sort by pk name if other option not provided
new_model.Meta.order_by.append(pkname)
new_model.Meta.orders_by.append(pkname)
return new_model

View File

@ -71,7 +71,7 @@ class ModelMeta:
signals: SignalEmitter
abstract: bool
requires_ref_update: bool
order_by: List[str]
orders_by: List[str]
def add_cached_properties(new_model: Type["Model"]) -> None: