Issue #21 new
Anonymous created an issue

KEYS = ['modify_time', 'user_id', 'school_id_o', 'school_id']

class SchoolIDOriginalIndex(HashIndex):
    def __init__(self, *args, **kwargs):
        kwargs['key_format'] = 'l'
        super(SchoolIDOriginalIndex, self).__init__(*args, **kwargs)

    def make_key_value(self, data):
        a_val = data.get('school_id_o') # works
        if a_val is not None:
            return a_val, None
        return None

    def make_key(self, key):
        return key
class SchoolIDOriginalIndex(HashIndex):
    def __init__(self, *args, **kwargs):
        kwargs['key_format'] = 'l'
        super(SchoolIDOriginalIndex, self).__init__(*args, **kwargs)

    def make_key_value(self, data):
        a_val = data.get(KEYS[2]) #later on, I use this index to query. It doesn't work 
        if a_val is not None:
            return a_val, None
        return None

    def make_key(self, key):
        return key

is it a bug ? or it is my misunderstanding.

Comments (0)

  1. Log in to comment