-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.py
More file actions
27 lines (24 loc) · 1.1 KB
/
settings.py
File metadata and controls
27 lines (24 loc) · 1.1 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
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from google.appengine.ext import db
import twitter
class MMSettings( db.Model ):
creds = db.ReferenceProperty( twitter.MMTwitterCreds )
learning_style = db.StringProperty()
learning_guru = db.StringProperty()
locquacity_onschedule = db.BooleanProperty( required=True, default=False )
locquacity_reply = db.BooleanProperty( required=True, default=False )
locquacity_speakonnew = db.BooleanProperty( required=True, default=False )
tweet_frequency = db.FloatProperty( required=True, default=1.0 )
tweet_chance = db.FloatProperty( required=True, default=1.0 )
greet_new_followers = db.BooleanProperty( default=False )
learn_retrospectively = db.BooleanProperty( default=False )
locquacity_greetnew = db.BooleanProperty( default=False )
def get_settings( creds ):
settings = MMSettings.all()
settings.filter( "creds = ", creds )
settings = settings.get()
if settings is None:
settings = MMSettings()
return settings