-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME
72 lines (56 loc) · 2.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
This app works with Tipfy 1.01b
1. copy tipadmin to the 'app' directory
2. add this to your apps_installed in your tipfy project config.py
you may also add sys_apps to the config with the value ['tipfy.ext.auth']
this will add admin for tipfy User
3. to the project's main urls.py add the get_rules function defined below
4. to the project's main.py add "import urls" then "urls.get_rules(app)" in the position shown below
5. specify admin only access in app.yaml. add to the handlers:
- url: /tipadmin/.*
script: main.py
login: admin
6. run the dev_appserver and go to /tipadmin/ (http://localhost:8000/tipadmin/)
this will create an admin for any classes inherited
from db.Model inside models.py
of apps in your apps_installed
here is an example config.py:
config = {}
# Configurations for the 'tipfy' module.
config['tipfy'] = {
'apps_installed': [
'tipadmin',
'mysuperapp',
],
'sys_apps':[
'tipfy.appengine.auth',
]
}
in your project's urls.py:
# -*- coding: utf-8 -*-
"""URL definitions."""
from tipfy.routing import Rule, import_string
rules = [
]
def get_rules(app):
for app_module in app.config['tipfy']['apps_installed']:
try:
# Load the urls module from the app and extend our rules.
app_rules = import_string('%s.urls' % app_module)
for rule in app_rules.rules:
app.router.add(rule)
except ImportError,e:
pass
in your projects's main.py:
import urls
app = App(rules=urls.rules, config=config, debug=debug)
urls.get_rules(app)
enable_appstats(app)
enable_jinja2_debugging()
The entity list fetches batches of 20, and will show a 'Fetch More' link to page
to the next set of entities, using datastore cursors.
You can specify an order for the entity list by adding the query string argument
'ob' to the url. example:
https://yourapp.appspot.com/tipadmin/mysuperapp/Item/?ob=-created
where created is an indexed property of the Item model. You must load the
ordered url before you click the Fetch More link, because the cursor is only
valid for the same query.