Esempio n. 1
0
class DocumentIndex2(indexes.Index):
    name = fields.IndexedString(
        Concat(F('type__name'), Value(' '), output_field=CharField()))
    text = fields.IndexedString('text')

    class Meta:
        model = Document
        range_step = 10000
Esempio n. 2
0
class AuthorIndex(indexes.Index):
    first_name = fields.IndexedString(model_attr='first_name')
    last_name = fields.IndexedString(model_attr='last_name')
    number = fields.Integer(model_attr='number')
    time = fields.DateTime(model_attr='time')

    class Meta:
        model = Author
        query = Author.objects.all()
Esempio n. 3
0
class DocumentIndex(indexes.Index):
    text = fields.IndexedString(model_attr='text')
    type_name = fields.IndexedString(model_attr='type__name')
    main_type_name = fields.IndexedString(model_attr='type__type__name')
    main_type_name1 = fields.IndexedString(model_attr=F('type__type__name'))
    type_name2 = fields.IndexedString(model_attr=Concat(
        'type__type__name', Value(
            " "), 'type__name', output_field=CharField()))
    date = fields.Date(model_attr='type__date')

    class Meta:
        model = Document
class DocumentIndex(indexes.Index):
    my_summary = fields.IndexedString(model_attr='summary')
    my_text = fields.IndexedString(model_attr='text')

    my_date = fields.Date(model_attr='date')
    my_added_time = fields.DateTime(model_attr='added_time')

    my_number = fields.Integer(model_attr='number')

    my_float = fields.Float(model_attr='float')

    my_bool = fields.Bool(model_attr='bool')

    unicode = fields.IndexedString(model_attr='unicode')

    slash = fields.IndexedString(model_attr='slash')

    class Meta:
        model = Document
        range_step = 100
Esempio n. 5
0
class DocumentIndex(indexes.Index):
    summary = fields.String(model_attr='summary')
    text = fields.IndexedString(model_attr='text')

    date = fields.Date(model_attr='date')
    added_time = fields.DateTime(model_attr='added_time')

    number = fields.Integer(model_attr='number')

    other_objects = Manager()
    objects = IndexManager()

    class Meta:
        model = Document
Esempio n. 6
0
class DocumentIndex1(indexes.Index):
    type_name2 = fields.IndexedString(model_attr=Concat(
        'text', Value(" "), 'text', output_field=CharField()))

    class Meta:
        model = Document
Esempio n. 7
0
class Author2Index(indexes.Index):
    first_name = fields.IndexedString(model_attr='first_name')

    class Meta:
        model = Author
        query = Author.objects.all()