Exemple #1
0
class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()
    age = index.Field()
    message = index.Text()
Exemple #2
0
class WorkflowIndexes(grok.Indexes):
    grok.site(Blog)
    grok.context(IWorkflowState)
    grok.name('entry_catalog')

    workflow_state = index.Field(attribute='getState')
    workflow_id = index.Field(attribute='getId')
class OAuth2Authenticate(grok.LocalUtility):
    grok.implements(IAuthentication)
    grok.site(IOAuthSite)

    def authenticate(self, request):
        ''' We are already authenticated if the session contains a principal. '''
        print 'authenticate called'
        sn = ISession(request)['OAuth2']
        if 'principal' in sn.keys():
            return sn['principal']

    def unauthenticatedPrincipal(self):
        return UnauthenticatedPrincipal()

    def unauthorized(self, id, request):
        ''' Remove the session item to force re-authentication '''
        sn = ISession(request)['OAuth2']
        if 'principal' in sn.keys():
            del sn['principal']

    def getPrincipal(self, id):
        print 'getprincipal called: %s' % id
        source = IOAuthPrincipalSource(grok.getSite())
        principal = source.find(id=id)
        if len(principal) == 1:
            return principal[0]
        raise PrincipalLookupError(id)
Exemple #4
0
class MammothIndexes(grok.Indexes):
    grok.context(Mammoth)
    grok.name('foo_catalog')
    grok.site(Herd)

    name = index.Field()
    age = index.Field()
    message = index.Text()
Exemple #5
0
class EditionCatalog(grok.Indexes):

    grok.site(asm.cms.cms.CMS)
    grok.context(asm.cms.interfaces.IIndexedContent)
    grok.name('edition_catalog')

    body = grok.index.Text()
    tags = grok.index.Set(attribute='tags_set')
Exemple #6
0
class EntryIndexes(grok.Indexes):
    grok.site(Blog)
    grok.context(IEntry)
    grok.name('entry_catalog')

    title = index.Text()
    content = index.Text()
    published = index.Field()
    categories = index.Set()
Exemple #7
0
class QAHUsersCatalog(grok.Indexes):
    grok.context(ITemporaryUser)
    grok.name('qah.users_catalog')
    grok.site(IUVCSite)
    grok.install_on(IQAHDeployment)

    uid = grok.index.Field()
    token = grok.index.Field()
    email = grok.index.Field()
Exemple #8
0
class WorkflowCatalog(grok.Indexes):
    grok.context(IApplicationContent)
    grok.name('workflow_catalog')
    grok.site(IUVCSite)
    grok.install_on(ICatalogDeployment)

    type = grok.index.Field()
    state = grok.index.Field()
    creator = grok.index.Field()
    modification_date = grok.index.Datetime()
    creation_date = grok.index.Datetime()
Exemple #9
0
class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    features = index.Set()
Exemple #10
0
class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()
    how_old = index.Field(attribute='age')
Exemple #11
0
class UserIndex(grok.Indexes):
    grok.site(Partybuilder)
    grok.context(User)
    grok.name('userindex')

    id = grok.index.Text()  # an internal Principal ID
Exemple #12
0
class BookIndexes(grok.Indexes):
    grok.site(BookShelf)
    grok.context(Book)

    title = index.Text()
Exemple #13
0
class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    foo = index.Field()
class MammothIndexes2(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth2)

    name = index.Field()
Exemple #15
0
class TuskIndex(grok.Indexes):
    grok.context(IPachyderm)
    grok.site(Herd)

    tusks = index.Text()