<s> SYSTEM_VERSION = '<STR_LIT>' <EOL> import datetime <EOL> import hashlib <EOL> from google . appengine . ext import db <EOL> from google . appengine . api import memcache <EOL> from google . appengine . api import users <EOL> class Member ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> auth = db . StringProperty ( required = False , indexed = True ) <EOL> deactivated = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> username = db . StringProperty ( required = False , indexed = True ) <EOL> username_lower = db . StringProperty ( required = False , indexed = True ) <EOL> password = db . StringProperty ( required = False , indexed = True ) <EOL> email = db . StringProperty ( required = False , indexed = True ) <EOL> email_verified = db . IntegerProperty ( required = False , indexed = True , default = <NUM_LIT:0> ) <EOL> website = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> psn = db . StringProperty ( required = False ) <EOL> twitter = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> twitter_oauth = db . IntegerProperty ( required = False , default = <NUM_LIT:0> ) <EOL> twitter_oauth_key = db . StringProperty ( required = False ) <EOL> twitter_oauth_secret = db . StringProperty ( required = False ) <EOL> twitter_oauth_string = db . StringProperty ( required = False ) <EOL> twitter_sync = db . IntegerProperty ( required = False , default = <NUM_LIT:0> ) <EOL> twitter_id = db . IntegerProperty ( required = False ) <EOL> twitter_name = db . StringProperty ( required = False ) <EOL> twitter_screen_name = db . StringProperty ( required = False ) <EOL> twitter_location = db . StringProperty ( required = False ) <EOL> twitter_description = db . TextProperty ( required = False ) <EOL> twitter_profile_image_url = db . StringProperty ( required = False ) <EOL> twitter_url = db . StringProperty ( required = False ) <EOL> twitter_statuses_count = db . IntegerProperty ( required = False ) <EOL> twitter_followers_count = db . IntegerProperty ( required = False ) <EOL> twitter_friends_count = db . IntegerProperty ( required = False ) <EOL> twitter_favourites_count = db . IntegerProperty ( required = False ) <EOL> use_my_css = db . IntegerProperty ( required = False , default = <NUM_LIT:0> ) <EOL> my_css = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> my_home = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> location = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> tagline = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> bio = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> avatar_large_url = db . StringProperty ( required = False , indexed = False ) <EOL> avatar_normal_url = db . StringProperty ( required = False , indexed = False ) <EOL> avatar_mini_url = db . StringProperty ( required = False , indexed = False ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> last_signin = db . DateTimeProperty ( ) <EOL> blocked = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> l10n = db . StringProperty ( default = '<STR_LIT>' ) <EOL> favorited_nodes = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> favorited_topics = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> favorited_members = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> followers_count = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> level = db . IntegerProperty ( required = True , default = <NUM_LIT:1000> ) <EOL> notifications = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> notification_position = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> private_token = db . StringProperty ( required = False , indexed = True ) <EOL> ua = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> newbie = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> noob = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> show_home_top = db . IntegerProperty ( required = True , default = <NUM_LIT:1> ) <EOL> show_quick_post = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> btc = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> github = db . StringProperty ( required = False , default = '<STR_LIT>' ) <EOL> @ property <EOL> def username_lower_md5 ( self ) : <EOL> return hashlib . md5 ( self . username_lower ) . hexdigest ( ) <EOL> @ property <EOL> def created_ts ( self ) : <EOL> return self . created . strftime ( "<STR_LIT:%s>" ) <EOL> def hasFavorited ( self , something ) : <EOL> if type ( something ) . __name__ == '<STR_LIT>' : <EOL> n = '<STR_LIT>' + str ( something . num ) + '<STR_LIT>' + str ( self . num ) <EOL> r = memcache . get ( n ) <EOL> if r : <EOL> return r <EOL> else : <EOL> q = db . GqlQuery ( "<STR_LIT>" , something , self ) <EOL> if q . count ( ) > <NUM_LIT:0> : <EOL> memcache . set ( n , True , <NUM_LIT> * <NUM_LIT> ) <EOL> return True <EOL> else : <EOL> memcache . set ( n , False , <NUM_LIT> * <NUM_LIT> ) <EOL> return False <EOL> else : <EOL> if type ( something ) . __name__ == '<STR_LIT>' : <EOL> n = '<STR_LIT>' + str ( something . num ) + '<STR_LIT>' + str ( self . num ) <EOL> r = memcache . get ( n ) <EOL> if r : <EOL> return r <EOL> else : <EOL> q = db . GqlQuery ( "<STR_LIT>" , something , self ) <EOL> if q . count ( ) > <NUM_LIT:0> : <EOL> memcache . set ( n , True , <NUM_LIT> * <NUM_LIT> ) <EOL> return True <EOL> else : <EOL> memcache . set ( n , False , <NUM_LIT> * <NUM_LIT> ) <EOL> return False <EOL> else : <EOL> if type ( something ) . __name__ == '<STR_LIT>' : <EOL> n = '<STR_LIT>' + str ( something . num ) + '<STR_LIT>' + str ( self . num ) <EOL> r = memcache . get ( n ) <EOL> if r : <EOL> return r <EOL> else : <EOL> q = db . GqlQuery ( "<STR_LIT>" , something , self . num ) <EOL> if q . count ( ) > <NUM_LIT:0> : <EOL> memcache . set ( n , True , <NUM_LIT> * <NUM_LIT> ) <EOL> return True <EOL> else : <EOL> memcache . set ( n , False , <NUM_LIT> * <NUM_LIT> ) <EOL> return False <EOL> else : <EOL> return False <EOL> class Counter ( db . Model ) : <EOL> name = db . StringProperty ( required = False , indexed = True ) <EOL> value = db . IntegerProperty ( ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_increased = db . DateTimeProperty ( auto_now = True ) <EOL> class Section ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> name = db . StringProperty ( required = False , indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = True ) <EOL> title_alternative = db . StringProperty ( required = False , indexed = True ) <EOL> header = db . TextProperty ( required = False ) <EOL> footer = db . TextProperty ( required = False ) <EOL> nodes = db . IntegerProperty ( default = <NUM_LIT:0> ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> class Node ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> section_num = db . IntegerProperty ( indexed = True ) <EOL> name = db . StringProperty ( required = False , indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = True ) <EOL> title_alternative = db . StringProperty ( required = False , indexed = True ) <EOL> header = db . TextProperty ( required = False ) <EOL> footer = db . TextProperty ( required = False ) <EOL> sidebar = db . TextProperty ( required = False ) <EOL> sidebar_ads = db . TextProperty ( required = False ) <EOL> category = db . StringProperty ( required = False , indexed = True ) <EOL> topics = db . IntegerProperty ( default = <NUM_LIT:0> ) <EOL> parent_node_name = db . StringProperty ( required = False , indexed = True ) <EOL> avatar_large_url = db . StringProperty ( required = False , indexed = False ) <EOL> avatar_normal_url = db . StringProperty ( required = False , indexed = False ) <EOL> avatar_mini_url = db . StringProperty ( required = False , indexed = False ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> class Topic ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> node = db . ReferenceProperty ( Node ) <EOL> node_num = db . IntegerProperty ( indexed = True ) <EOL> node_name = db . StringProperty ( required = False , indexed = True ) <EOL> node_title = db . StringProperty ( required = False , indexed = False ) <EOL> member = db . ReferenceProperty ( Member ) <EOL> member_num = db . IntegerProperty ( indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = True ) <EOL> content = db . TextProperty ( required = False ) <EOL> content_rendered = db . TextProperty ( required = False ) <EOL> content_length = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> has_content = db . BooleanProperty ( required = True , default = True ) <EOL> hits = db . IntegerProperty ( default = <NUM_LIT:0> ) <EOL> stars = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> replies = db . IntegerProperty ( default = <NUM_LIT:0> ) <EOL> created_by = db . StringProperty ( required = False , indexed = True ) <EOL> last_reply_by = db . StringProperty ( required = False , indexed = True ) <EOL> source = db . StringProperty ( required = False , indexed = True ) <EOL> type = db . StringProperty ( required = False , indexed = True ) <EOL> type_color = db . StringProperty ( required = False ) <EOL> explicit = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> last_touched = db . DateTimeProperty ( ) <EOL> class Reply ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> topic = db . ReferenceProperty ( Topic ) <EOL> topic_num = db . IntegerProperty ( indexed = True ) <EOL> member = db . ReferenceProperty ( Member ) <EOL> member_num = db . IntegerProperty ( indexed = True ) <EOL> content = db . TextProperty ( required = False ) <EOL> source = db . StringProperty ( required = False , indexed = True ) <EOL> created_by = db . StringProperty ( required = False , indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> highlighted = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> class Avatar ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> name = db . StringProperty ( required = False , indexed = True ) <EOL> content = db . BlobProperty ( ) <EOL> class Note ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> member = db . ReferenceProperty ( Member ) <EOL> member_num = db . IntegerProperty ( indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = True ) <EOL> content = db . TextProperty ( required = False ) <EOL> body = db . TextProperty ( required = False ) <EOL> length = db . IntegerProperty ( indexed = False , default = <NUM_LIT:0> ) <EOL> edits = db . IntegerProperty ( indexed = False , default = <NUM_LIT:1> ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> class PasswordResetToken ( db . Model ) : <EOL> token = db . StringProperty ( required = False , indexed = True ) <EOL> email = db . StringProperty ( required = False , indexed = True ) <EOL> member = db . ReferenceProperty ( Member ) <EOL> valid = db . IntegerProperty ( required = False , indexed = True , default = <NUM_LIT:1> ) <EOL> timestamp = db . IntegerProperty ( required = False , indexed = True , default = <NUM_LIT:0> ) <EOL> class Place ( db . Model ) : <EOL> num = db . IntegerProperty ( required = False , indexed = True ) <EOL> ip = db . StringProperty ( required = False , indexed = True ) <EOL> name = db . StringProperty ( required = False , indexed = False ) <EOL> visitors = db . IntegerProperty ( required = False , default = <NUM_LIT:0> , indexed = True ) <EOL> longitude = db . FloatProperty ( required = False , default = <NUM_LIT:0.0> , indexed = True ) <EOL> latitude = db . FloatProperty ( required = False , default = <NUM_LIT:0.0> , indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> class PlaceMessage ( db . Model ) : <EOL> num = db . IntegerProperty ( indexed = True ) <EOL> place = db . ReferenceProperty ( Place ) <EOL> place_num = db . IntegerProperty ( indexed = True ) <EOL> member = db . ReferenceProperty ( Member ) <EOL> content = db . TextProperty ( required = False ) <EOL> in_reply_to = db . SelfReferenceProperty ( ) <EOL> source = db . StringProperty ( required = False , indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> class Checkin ( db . Model ) : <EOL> place = db . ReferenceProperty ( Place ) <EOL> member = db . ReferenceProperty ( Member ) <EOL> last_checked_in = db . DateTimeProperty ( auto_now = True ) <EOL> class Site ( db . Model ) : <EOL> num = db . IntegerProperty ( required = False , indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = False ) <EOL> slogan = db . StringProperty ( required = False , indexed = False ) <EOL> description = db . TextProperty ( required = False ) <EOL> domain = db . StringProperty ( required = False , indexed = False ) <EOL> analytics = db . StringProperty ( required = False , indexed = False ) <EOL> home_categories = db . TextProperty ( required = False , indexed = False ) <EOL> meta = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> home_top = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> theme = db . StringProperty ( required = False , default = '<STR_LIT:default>' ) <EOL> l10n = db . StringProperty ( default = '<STR_LIT>' ) <EOL> use_topic_types = db . BooleanProperty ( default = False ) <EOL> topic_types = db . TextProperty ( default = '<STR_LIT>' ) <EOL> topic_view_level = db . IntegerProperty ( required = True , default = - <NUM_LIT:1> ) <EOL> topic_create_level = db . IntegerProperty ( required = True , default = <NUM_LIT:1000> ) <EOL> topic_reply_level = db . IntegerProperty ( required = True , default = <NUM_LIT:1000> ) <EOL> data_migration_mode = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> class Minisite ( db . Model ) : <EOL> num = db . IntegerProperty ( required = False , indexed = True ) <EOL> name = db . StringProperty ( required = False , indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = False ) <EOL> description = db . TextProperty ( default = '<STR_LIT>' ) <EOL> pages = db . IntegerProperty ( default = <NUM_LIT:0> ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> class Page ( db . Model ) : <EOL> num = db . IntegerProperty ( required = False , indexed = True ) <EOL> name = db . StringProperty ( required = False , indexed = True ) <EOL> title = db . StringProperty ( required = False , indexed = False ) <EOL> minisite = db . ReferenceProperty ( Minisite ) <EOL> content = db . TextProperty ( default = '<STR_LIT>' ) <EOL> content_rendered = db . TextProperty ( default = '<STR_LIT>' ) <EOL> content_type = db . StringProperty ( default = '<STR_LIT>' ) <EOL> weight = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> mode = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> hits = db . IntegerProperty ( required = True , default = <NUM_LIT:0> ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) <EOL> class NodeBookmark ( db . Model ) : <EOL> node = db . ReferenceProperty ( Node , indexed = True ) <EOL> member = db . ReferenceProperty ( Member , indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> class TopicBookmark ( db . Model ) : <EOL> topic = db . ReferenceProperty ( Topic , indexed = True ) <EOL> member = db . ReferenceProperty ( Member , indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> class MemberBookmark ( db . Model ) : <EOL> one = db . ReferenceProperty ( Member , indexed = True ) <EOL> member_num = db . IntegerProperty ( indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> class Notification ( db . Model ) : <EOL> num = db . IntegerProperty ( required = False , indexed = True ) <EOL> member = db . ReferenceProperty ( Member , indexed = True ) <EOL> for_member_num = db . IntegerProperty ( required = False , indexed = True ) <EOL> type = db . StringProperty ( required = False , indexed = True ) <EOL> payload = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> label1 = db . StringProperty ( required = False , indexed = False ) <EOL> link1 = db . StringProperty ( required = False , indexed = False ) <EOL> label2 = db . StringProperty ( required = False , indexed = False ) <EOL> link2 = db . StringProperty ( required = False , indexed = False ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> class Item ( db . Model ) : <EOL> title = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> description = db . TextProperty ( required = False , default = '<STR_LIT>' ) <EOL> price = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> category = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> column = db . IntegerProperty ( required = False , default = <NUM_LIT:1> , indexed = True ) <EOL> link_official = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> link_picture = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> link_buy = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> node_name = db . StringProperty ( required = False , indexed = False , default = '<STR_LIT>' ) <EOL> published = db . IntegerProperty ( required = False , default = <NUM_LIT:0> , indexed = True ) <EOL> created = db . DateTimeProperty ( auto_now_add = True ) <EOL> last_modified = db . DateTimeProperty ( auto_now = True ) </s>
