SQLAlchemy 扩展

class ext.sqlalchemy.ModelAdminModule(*args, **kwargs)

SQLAlchemy model admin module builder.

count_list(search=None)

Counts filtered list.

Parameters: search – The string for quick search

create_object()

New object instance new object.

delete_object(object)

Deletes object.

Parameters: object – The object to delete

edit_query_factory

Returns query for object edition.

form_view

alias of ObjectFormView

get_actions_for_object(object)

“Returns actions for object as and tuple list.

Parameters: object – The object

get_object(pk)

Gets back object by primary key.

Parameters: pk – The object primary key

get_object_list(search=None, order_by_name=None, order_by_direction=None, offset=None, limit=None)

Returns ordered, filtered and limited query.

Parameters:

  • search – The string for search filter
  • order_by_name – The field name to order by
  • order_by_direction – The field direction
  • offset – The offset position
  • limit – The limit

list_query_factory

Returns non filtered list query.

save_object(obj)

Saves object.

Parameters: object – The object to save