class State(JsonRecord): id = IdProperty() state_id = IntProperty() name = UnicodeProperty() population_count = UnicodeProperty() projects_count = IntProperty(extraneous=True) literacy_percent = FloatProperty() sent_amount = FloatProperty() capital = UnicodeProperty()
class Project(JsonRecord): id = IdProperty() project_id = IntProperty() primary_key = [project_id] name = UnicodeProperty() description = UnicodeProperty() org_description = UnicodeProperty() purpose = UnicodeProperty() additional_info = UnicodeProperty() secondary_focus = StringProperty() state = StringProperty() project_type = IntProperty() focus = IntProperty() area = StringProperty() address = UnicodeProperty() contact_chapter = IdProperty(json_name="contact_chapter") first_funded = IntProperty() total_funds = FloatProperty() status = IntProperty() images = Property(isa=list)
class CompareThisOrz(SurrogatePerson): def full_number(self): number = normalize_phone(self.phone_number) m = re.match( r"(\d{3})\s*(?:[.-]\s*)?(\d{4})", number, ) if m: return "(%.3d) %s-%s" % ( self.area_code, m.group(1), m.group(2), ) else: return number area_code = IntProperty(check=lambda n: 0 < n < 1000) phone_number = StringProperty(compare_as=full_number)
class FocusType(JsonRecord): id = IdProperty() focus_type_id = IntProperty() title = UnicodeProperty() description = UnicodeProperty()
class ProjectType(JsonRecord): id = IdProperty() project_type_id = IntProperty() title = UnicodeProperty() description = UnicodeProperty()
class Status(JsonRecord): id = IdProperty() status_id = IntProperty() title = UnicodeProperty() description = UnicodeProperty()
class Chapter(JsonRecord): id = IdProperty() chapter_id = IntProperty() name = UnicodeProperty() established_year = IntProperty() chapter_url = StringProperty()