Admin panel for Google App Engine NDB models
http://ndbadmin-live.appspot.com/
Included live application to demonstrate admin UI.
I developed this admin panel for my own usage.
In this app Admin panel use twitter bootstrap CSS style.
All work is done inside your ndb.Model() model. Add Meta() class inside it,
where to be defined create/edit form fields and templates for list/new/edit/delete item(s).
Example:
class Meta():
def __init__(self):
self.fields = [
fields.TextField("name", "Name", required=True),
fields.BigTextField("description", "Description")
]
# optional
# templates, '/templates/admin/[model]/' path
self.c = "" # new item template
self.r = "" # items list template
self.u = "" # edit item template
self.d = "" # delete item template
# ordering
order_by = ModelName.field_name
Admin UI use HTML 5 fields types and validation.
Now CRUD has next types of fields available to use:
Fields options:
To sort items in list add to Meta order_by
field with the name of model’s field to sort by.
Example:
class Item(ndb.Model):
name = ndb.StringProperty()
class Meta():
def __init__(self):
self.order_by = Item.name
By default items in list paginated by 10 items per page. To change this,
add PER_PAGE
variable in settings file.