예제 #1
0
class ConversationCreateForm(Form):
    interest_id = HexField(source='url', filter=interest_opaque_to_id)
    message = StringField(minlength=1, maxlength=2000, source='form')
    lat = FloatField(required=False, source='form')
    lon = FloatField(required=False, source='form')

    @property
    def location(self):
        if self.lat and self.lon:
            return [self.lat, self.lon]
        else:
            return None
예제 #2
0
class ConversationIndexForm(Form):
    interest_id = HexField(source='url', filter=interest_opaque_to_id)
    order = StringField(allowed=['recent', 'popular', 'distance'],
                        default='popular')
    radius = IntField(required=False, min=1, max=100000)
    page = IntField(default=1, min=1)
    per_page = IntField(default=10, min=1, max=50)
    lat = FloatField(required=False, needs='lon')
    lon = FloatField(required=False, needs='lat')
    after = DateField(required=False, format='%Y-%m-%dT%H:%M:%S')

    @property
    def location(self):
        if self.lat and self.lon:
            return [self.lat, self.lon]
        else:
            return None
예제 #3
0
class ConversationShowReplyForm(Form):
    interest_id = HexField(source='url', filter=interest_opaque_to_id)
    parent_id = HexField(source='url', filter=conversation_opaque_to_id)
    id = HexField(source='url', filter=conversation_opaque_to_id)
예제 #4
0
class ConversationCreateReplyForm(ConversationCreateForm):
    parent_id = HexField(source='url', filter=conversation_opaque_to_id)
예제 #5
0
class InterestFollowersForm(Form):
    id = HexField(length=8, source='url', filter=interest_opaque_to_id)
    page = IntField(default=1, min=1)
    per_page = IntField(default=10, min=1, max=50)
예제 #6
0
class InterestIdForm(Form):
    id = HexField(length=8, source='url', filter=interest_opaque_to_id)