Component Registry

You need to register server-side components through components.py file.

  • Apps and Services
  • Views
  • Templates
  • Actions
  • Flows and flow data
  • Menus
  • Search commands

Apps and Services

from service import SiteService
class AppReg (AppCompRegCommonBusiness):
    def __init__(self):
        super(AppReg, self).__init__(__name__)
        # Application
        self._reg.registerApp(__name__, title='My App', slug='my-app')
        # Services
        self._reg.registerService(__name__, serviceName='MyService', className=SiteService)

By default your app comes with SiteService. You can have as many services as you want, you can create them here and implement in service.py. Each use case can become a service, with views and actions associated.

Views

self._reg.registerView(__name__, serviceName='MyService', viewName='myView', slug='my-view',
                       className=SiteService, method='view_mine')

You refer to above service name, defining a view name, slug and which class and method implements it.

Templates

self._reg.registerTemplate(__name__, viewName='myView', name='my_template')

You map views and templates. Templates will be found in templates directory. They can be window or popup types, holding different directories for ech template type.

Actions

self._reg.registerAction(__name__, serviceName='MyService', actionName='changeStatus', slug='change-status',
                            className=SiteService, method='change_status')

Your SiteService would need a method ``change_status``.

Flows and flow data

self._reg.registerFlow(__name__, 'activate-user', resetStart=True, deleteOnEnd=True, jumpToView=False)
self._reg.registerFlowView(__name__, 'activate-user', actionName='activateUser', viewNameTarget='activationUser')

You would attach additional attributes to map flow variables.

Search commands

self._reg.registerSearch(__name__, text='Change Password', viewName=Views.CHANGE_PASSWORD)

Allows to map views and actions to happen at auto-complete box in top menu. When clicked, a new view (window or popup) would come or action be executed, redirecting in this case to another view.

Read the Docs v: latest
Versions
latest
0.2.1
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.