Help Topics¶
Transition From Django¶
If you are coming from Django you are probably wondering which features are offered here and to which Django features they correspond. To help you with this, here are some guidelines on getting used to this system.
ModelAdmin
Configuration Options¶
Django as a myriad of configuration options on its ModelAdmin. Not all features are supported here and they are distributed differently (due to the nature of this library), so here is some guidance on getting around.
First of all, you have to know that we split things a bit more up around here because we are already based on other libraries. Roughly speaking though we can define some equivalents:
- Django’s
ModelAdmin
is closest toviews.CRUDView
. Here we perform basic configuration actions, set routes and so on. However, contrary to Django not all configuration is performed here. And instead of a registration of theModelAdmin
with theModel
, we define aForm
on it that in turn links to the model. - The
Form
subclassesforms.ModelForm
. There is no equivalent in Django, as it creates the form automatically from the relation between the model and the admin class. However, because of the way the integration works (the form is actually created by WTForms-Alchemy) we need this form. This is the place where you configure behavior on actual form instances. - The
Model
in turn is very close to that of Django. But since our systems are not so closely integrated, the coupling is much lower (which can be good or bad). The models are mostly just SQLAlchemy models with some additional configuration done by WTForms-Alchemy.
Now that you know how the parts are constructed take a look at the following
table. It lists each Django option on ModelAdmin
and provides the
equivalent in either this library, WTForms-Alchemy or SQLAlchemy. If a behavior
is not supported here yet, it is denoted by “NYI” (not yet implemented).
Django | Us |
---|---|
actions |
Adding Actions to Forms |
actions_on_top |
NYI |
actions_on_bottomg |
NYI |
actions_selection_count |
NYI |
date_hierarchy |
NYI |
exclude |
Form.Meta.exclude |
fields |
Form.Meta.only |
fieldsets |
ModelForm.fieldsets |
filter_horizontal |
NYI |
filter_vertical |
NYI |
form |
CRUDView.Form |
formfield_overrides |
Adding/overriding fields |
inlines |
ModelForm.inlines |
list_display |
CRUDView.list_display |
list_display_links |
CRUDView.list_display_links |
list_editable |
NYI |
list_filter |
NYI |
list_max_show_all |
NYI |
list_per_page |
NYI |
list_select_related |
NYI |
ordering |
NYI |
paginator |
NYI |
prepoulated_fields |
NYI |
preserve_filters |
NYI |
radio_fields |
NYI |
raw_id_fields |
NYI |
readonly_fields |
NYI |
save_as |
NYI |
save_on_top |
NYI |
search_fields |
NYI |
add_form_template |
NYI |
change_form_template |
NYI |
change_list_template |
NYI |
delete_confirmation_template |
NYI |
delete_selected_confirmation_template |
NYI |
object_history_template |
NYI |
save_model |
NYI |
delete_model |
NYI |
save_formset |
NYI |
get_ordering |
NYI |
get_search_results |
NYI |
save_related |
NYI |
get_readonly_fields |
NYI |
get_prepopulated_fields |
NYI |
get_list_display |
NYI |
get_list_display_links |
NYI |
get_fieldsets |
NYI |
get_list_filter |
NYI |
get_inline_instances |
NYI |
get_urls |
NYI |
get_form |
NYI |
get_formsets |
NYI |
formfield_for_foreignkey |
NYI |
formfield_for_manytomany |
NYI |
formfield_for_choice_field |
NYI |
get_changelist |
NYI |
get_changelist_form |
NYI |
get_changelist_formset |
NYI |
has_add_permission |
NYI |
has_change_permission |
NYI |
has_delete_permission |
NYI |
get_queryset |
NYI |
message_user |
NYI |
get_paginator |
NYI |
add_view |
NYI |
change_view |
NYI |
changelist_view |
NYI |
delete_view |
NYI |
history_view |
NYI |
Media |
NYI |