-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
50 lines (44 loc) · 1.4 KB
/
models.py
File metadata and controls
50 lines (44 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!python
# -*- coding: utf-8 -*-
from collections import namedtuple
from wtforms import Form, DecimalField, StringField, FileField, validators
LOCATIONS = [
{
"name": "edinburgh",
"human_readable_name": "Edinburgh",
"centre": [55.947, -3.2],
"scale": 11
},
{
"name": "glasgow",
"human_readable_name": "Glasgow",
"centre": [55.859, -4.285],
"scale": 11
},
{
"name": "peak-district",
"human_readable_name": "Peak District",
"centre": [53.283, -1.761],
"scale": 11
},
{
"name": "off-the-grid",
"human_readable_name": "Off The Grid",
"centre": [56.547, -5.690],
"scale": 11
},
]
Sound = namedtuple('Sound', ['soundcloud_id',
'latitude',
'longitude',
'human_readable_location',
'description'])
class UploadSoundForm(Form):
"""
Form to upload a Sound and associated information.
"""
latitude = DecimalField(u'Latitude')
longitude = DecimalField(u'Longitude')
human_readable_location = StringField(u'Where did you record this sound?', validators=[validators.Length(max=140)])
description = StringField(u'What is the sound? When did you record it?', validators=[validators.Length(max=140)])
sound = FileField(u'Sound File')