Skip to content

tipfy app that dynamically creates an admin for google appengine models

Notifications You must be signed in to change notification settings

johnwlockwood/tipfy-admin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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.

About

tipfy app that dynamically creates an admin for google appengine models

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages