add release docs, change tests
This commit is contained in:
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user