How to use the grok.index.Field function in grok

To help you get started, we’ve selected a few grok examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zopefoundation / grok / src / grok / ftests / catalog / indexes_multiple_conflict.py View on Github external
name = schema.TextLine(title=u'Name')

class IMammoth2(Interface):
    name = schema.TextLine(title=u'Name')

class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()

class MammothIndexes2(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth2)

    name = index.Field()
github zopefoundation / grok / src / grok / ftests / catalog / indexes_multiple.py View on Github external
def message2():
        """Message the mammoth has for the world."""

class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()
    age = index.Field()
    message = index.Text()

class MammothIndexes2(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth2)

    name2 = index.Field()
    age2 = index.Field()
    message2 = index.Text()
github zopefoundation / grok / src / grok / ftests / catalog / indexes.py View on Github external
pass

class Herd2(grok.Container, grok.Application):
    pass

class IMammoth(Interface):
    name = schema.TextLine(title=u'Name')
    age = schema.Int(title=u'Age')
    def message():
        """Message the mammoth has for the world."""

class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()
    age = index.Field()
    message = index.Text()

class Mammoth(grok.Model):
    grok.implements(IMammoth)

    def __init__(self, name, age, message):
        self.name = name
        self.age = age
        self._message = message

    def message(self):
        return self._message
github zopefoundation / grok / src / grok / ftests / catalog / indexes_multiple.py View on Github external
age = schema.Int(title=u'Age')
    def message():
        """Message the mammoth has for the world."""

class IMammoth2(Interface):
    name2 = schema.TextLine(title=u'Name')
    age2 = schema.Int(title=u'Age')
    def message2():
        """Message the mammoth has for the world."""

class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()
    age = index.Field()
    message = index.Text()

class MammothIndexes2(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth2)

    name2 = index.Field()
    age2 = index.Field()
    message2 = index.Text()
github zopefoundation / grok / src / grok / ftests / catalog / indexes_no_app.py View on Github external
"""
import grok
from grok import index

class Herd(grok.Container, grok.Application):
    pass

class Mammoth(grok.Model):
    pass

class MammothIndexes(grok.Indexes):
    grok.context(Mammoth)
    grok.name('foo_catalog')
    
    name = index.Field()
    age = index.Field()
    message = index.Text()
github zopefoundation / grok / src / grok / ftests / catalog / indexes_no_app.py View on Github external
"""
import grok
from grok import index

class Herd(grok.Container, grok.Application):
    pass

class Mammoth(grok.Model):
    pass

class MammothIndexes(grok.Indexes):
    grok.context(Mammoth)
    grok.name('foo_catalog')
    
    name = index.Field()
    age = index.Field()
    message = index.Text()
github zopefoundation / grok / src / grok / ftests / catalog / indexes_multiple.py View on Github external
"""Message the mammoth has for the world."""

class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    name = index.Field()
    age = index.Field()
    message = index.Text()

class MammothIndexes2(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth2)

    name2 = index.Field()
    age2 = index.Field()
    message2 = index.Text()
github zopefoundation / grok / src / grok / ftests / catalog / indexes_nonexistent.py View on Github external
from grok import index

class Herd(grok.Container, grok.Application):
    pass

class IMammoth(Interface):
    name = schema.TextLine(title=u'Name')
    age = schema.Int(title=u'Age')
    def message():
        """Message the mammoth has for the world."""

class MammothIndexes(grok.Indexes):
    grok.site(Herd)
    grok.context(IMammoth)

    foo = index.Field()
github zopefoundation / grok / src / grok / ftests / catalog / indexes_name.py View on Github external
class Mammoth(grok.Model):
    def __init__(self, name, age, message):
        self.name = name
        self.age = age
        self._message = message

    def message(self):
        return self._message

class MammothIndexes(grok.Indexes):
    grok.context(Mammoth)
    grok.name('foo_catalog')
    grok.site(Herd)
    
    name = index.Field()
    age = index.Field()
    message = index.Text()