class ISegment(IItem): metadata("id_strava") index_field("id_strava", type="text") id_strava = schema.TextLine(title="Strava id") metadata("name") index_field("name", type="text") name = schema.TextLine(title="Name") metadata("type_activity") index_field("type_activity", type="text") type_activity = schema.TextLine(title="Type") # Pass to vocabulary metadata("distance") index_field("distance", type="float") distance = schema.Int(title="Distance") average_grade = schema.Float(title="Average grade") maximum_grade = schema.Float(title="Maximum grade") elevation_high = schema.Float(title="Elevation high") elevation_low = schema.Float(title="Elevation loc") climb_category = schema.Int(title="Climb category") city = schema.TextLine(title="City") state = schema.TextLine(title="State") country = schema.TextLine(title="Country")
class ICMSBehavior(Interface): index_field('hidden_navigation', type='boolean') fieldset('hidden_navigation', 'settings') hidden_navigation = schema.Bool(title='Should be hidden on navigation', required=False, default=False) index_field('language', type='keyword') fieldset('language', 'categorization') language = schema.Choice(title='Language', required=False, source='languages') index_field('content_layout', type='keyword') fieldset('content_layout', 'settings') content_layout = schema.Choice(title='Content Layout', required=False, source='content_layouts', default='default') index_field('position_in_parent', type='int') position = schema.Int(title='Position in parent', required=False) index_field('review_state', type='keyword') review_state = schema.Choice(readonly=True, title='Workflow review state', required=False, source='worklow_states') history = schema.List(title='History list', readonly=True, required=False, value_type=schema.JSONField(title='History element', schema=HISTORY_SCHEMA))
class IExample(IResource): metadata('categories') index_field('boolean_field', type='boolean') boolean_field = schema.Bool(required=False) index_field('categories', field_mapping=CATEGORIES_MAPPING) categories = schema.List(title='categories', default=[], value_type=schema.JSONField(title='term', schema=TERM_SCHEMA)) textline_field = schema.TextLine(title='kk', widget='testing', required=False) text_field = schema.Text(required=False) dict_value = schema.Dict(key_type=schema.TextLine(), value_type=schema.TextLine(), required=False) datetime = schema.Datetime(required=False) write_permission(write_protected='example.MyPermission') write_protected = schema.TextLine( title='Write protected field', required=False, ) default_factory_test = schema.Text(defaultFactory=lambda: 'foobar') context_default_factory_test = schema.Text( defaultFactory=ContextDefaultFactory())
class IExample(IResource): metadata("categories") index_field("boolean_field", type="boolean") boolean_field = schema.Bool(required=False) index_field("categories", field_mapping=CATEGORIES_MAPPING) categories = schema.List(title="categories", default=[], value_type=schema.JSONField(title="term", schema=TERM_SCHEMA)) textline_field = schema.TextLine(title="kk", widget="testing", required=False) text_field = schema.Text(required=False) dict_value = schema.Dict(key_type=schema.TextLine(), value_type=schema.TextLine(), required=False) datetime = schema.Datetime(required=False) jsonfield_value = schema.JSONField(schema={"type": "array"}, required=False) write_permission(write_protected="example.MyPermission") write_protected = schema.TextLine(title="Write protected field", required=False) default_factory_test = schema.Text(defaultFactory=lambda: "foobar") context_default_factory_test = schema.Text( defaultFactory=ContextDefaultFactory())
class IUser(IFolder, IPrincipal): username = schema.TextLine(title=_("Username"), required=False) index_field("email", index_name="user_email", type="keyword") email = schema.TextLine(title=_("Email"), required=False) index_field("name", index_name="user_name", type="textkeyword") name = schema.TextLine(title=_("Name"), required=False) read_permission(password="******") password = schema.TextLine(title=_("Password"), required=False) write_permission(user_groups="guillotina.ManageUsers") user_groups = schema.List(title=_("Groups"), value_type=schema.TextLine(), required=False) write_permission(user_roles="guillotina.ManageUsers") index_field("user_roles", type="textkeyword") user_roles = schema.List(title=_("Roles"), value_type=schema.TextLine(), required=False) write_permission(user_permissions="guillotina.ManageUsers") user_permissions = schema.List(title=_("Permissions"), value_type=schema.TextLine(), required=False, default=[]) write_permission(disabled="guillotina.ManageUsers") index_field("disabled", type="boolean") disabled = schema.Bool(title=_("Disabled"), default=False) properties = schema.Dict(required=False, default={})
class IDublinCore(Interface): index_field('creators', type='keyword') index_field('tags', type='keyword') index_field('contributors', type='keyword') title = schema.TextLine( title=u'Title', description=u"The first unqualified Dublin Core 'Title' element value.", required=False) description = schema.Text( title=u'Description', description=u"The first unqualified Dublin Core 'Description' element value.", required=False) creation_date = schema.Datetime( title=u'Creation Date', description=u"The date and time that an object is created. " u"\nThis is normally set automatically.", required=False) modification_date = schema.Datetime( title=u'Modification Date', description=u"The date and time that the object was last modified in a\n" u"meaningful way.", required=False) effective_date = schema.Datetime( title=u'Effective Date', description=u"The date and time that an object should be published. ", required=False) expiration_date = schema.Datetime( title=u'Expiration Date', description=u"The date and time that the object should become unpublished.", required=False) creators = schema.Tuple( title=u'Creators', description=u"The unqualified Dublin Core 'Creator' element values", value_type=schema.TextLine(), required=False) tags = schema.Tuple( title=u'Tags', description=u"The unqualified Dublin Core 'Tags' element values", value_type=schema.TextLine(), required=False) publisher = schema.Text( title=u'Publisher', description=u"The first unqualified Dublin Core 'Publisher' element value.", required=False) contributors = schema.Tuple( title=u'Contributors', description=u"The unqualified Dublin Core 'Contributor' element values", value_type=schema.TextLine(), required=False)
class IPatient(IFhirContent, IContentIndex): index_field( "patient_resource", type="object", field_mapping=fhir_resource_mapping("Patient"), fhirpath_enabled=True, resource_type="Patient", fhir_release=FHIR_VERSION.R4, ) index_field("p_type", type="keyword") p_type = TextLine(title="Patient Type", required=False) patient_resource = FhirField(title="Patient Resource", resource_type="Patient", fhir_release="R4")
class IOrganization(IFhirContent, IContentIndex): index_field( "organization_resource", type="object", field_mapping=fhir_resource_mapping("Organization"), fhirpath_enabled=True, resource_type="Organization", fhir_release=FHIR_VERSION.R4, ) index_field("org_type", type="keyword") org_type = TextLine(title="Organization Type", required=False) organization_resource = FhirField(title="Organization Resource", resource_type="Organization", fhir_release="R4")
class IGroup(IFolder): index_field("name", index_name="group_name", type="textkeyword") name = schema.TextLine(title=_("Group name"), required=False) description = schema.TextLine(title=_("Group Description"), required=False) index_field("user_roles", index_name="group_user_roles", type="textkeyword") user_roles = schema.List(title=_("Roles"), value_type=schema.TextLine(), required=False) index_field("users", index_name="group_users", type="textkeyword") users = schema.List(title=_("Users"), value_type=schema.TextLine(), required=False, default=[])
class ICMSBehavior(Interface): index_field("is_folderish", store=True, type="boolean") is_folderish = schema.Bool(title="Is a folderish object", readonly=True) index_field("hidden_navigation", store=True, type="boolean") fieldset("hidden_navigation", "settings") hidden_navigation = schema.Bool(title="Should be hidden on navigation", required=False, default=False) index_field("language", store=True, type="keyword") fieldset("language", "categorization") language = schema.Choice(title="Language", required=False, source="languages") index_field("content_layout", store=True, type="keyword") fieldset("content_layout", "settings") content_layout = schema.Choice( title="Content Layout", required=False, source="content_layouts", default="default", ) fieldset("allow_discussion", "settings") allow_discussion = schema.Bool(title="Allow discussion", required=False, default=False) # not absolute positioning, just a relative positioning # based on ordered numbers. It won't be numbers like 1,2,3,4,5,etc index_field("position_in_parent", type="int") position_in_parent = schema.Int(title="Position in parent", default=-1, required=False) comments = schema.Dict( title="Comments list field", required=False, key_type=schema.TextLine(title="CommentID"), value_type=schema.JSONField(title="Comment", schema=DISCUSSION_SCHEMA), )
class IOrganization(IFhirContent, IContentIndex): index_field('organization_resource', type='object', field_mapping=fhir_resource_mapping('Organization'), fhir_field_indexer=True, resource_type='Organization') organization_resource = FhirField(title='Organization Resource', resource_type='Organization')
class IFollowing(Interface): index_field("favorites", type="keyword", store=True) read_permission(favorites="guillotina.") write_permission(favorites="guillotina.NoBody") favorites = schema.List(title=u"favorites", default=[], value_type=schema.TextLine(title="follower")) favorite = schema.Bool(title=u"Current user has it favorited", default=False)
class IFollowing(Interface): index_field('favorites', type='keyword', store=True) read_permission(favorites='guillotina.') write_permission(favorites='guillotina.NoBody') favorites = schema.List(title=u'favorites', default=[], value_type=schema.TextLine(title='follower')) favorite = schema.Bool(title=u'Current user has it favorited', default=False)
class IEncounter(IFhirContent, IContentIndex): index_field( "encounter_resource", type="object", field_mapping=fhir_resource_mapping("Encounter"), fhirpath_enabled=True, resource_type="Encounter", fhir_release=FHIR_VERSION.R4, ) encounter_resource = FhirField(title="Encounter Resource", resource_type="Encounter", fhir_release="R4")
class IObservation(IFhirContent, IContentIndex): index_field( "observation_resource", type="object", field_mapping=fhir_resource_mapping("Observation"), fhirpath_enabled=True, resource_type="Observation", fhir_release=FHIR_VERSION.R4, ) observation_resource = FhirField(title="Observation Resource", resource_type="Observation", fhir_release="R4")
class ITask(IFhirContent, IContentIndex): index_field( "task_resource", type="object", field_mapping=fhir_resource_mapping("Task"), fhirpath_enabled=True, resource_type="Task", fhir_release=FHIR_VERSION.R4, ) task_resource = FhirField(title="Task Item Resource", resource_type="Task", fhir_release="R4")
class IChargeItem(IFhirContent, IContentIndex): index_field( "chargeitem_resource", type="object", field_mapping=fhir_resource_mapping("ChargeItem"), fhirpath_enabled=True, resource_type="ChargeItem", fhir_release=FHIR_VERSION.R4, ) chargeitem_resource = FhirField(title="Charge Item Resource", resource_type="ChargeItem", fhir_release="R4")
class IExample(IResource): metadata('categories') index_field('categories', type='nested') categories = schema.List(title='categories', default=[], value_type=schema.JSONField(title='term', schema=TERM_SCHEMA)) textline_field = schema.TextLine() text_field = schema.Text() dict_value = schema.Dict(key_type=schema.TextLine(), value_type=schema.TextLine()) datetime = schema.Datetime()
class IMedicationRequest(IFhirContent, IContentIndex): index_field( "medicationrequest_resource", type="object", field_mapping=fhir_resource_mapping("MedicationRequest"), fhirpath_enabled=True, resource_type="MedicationRequest", fhir_release=FHIR_VERSION.R4, ) medicationrequest_resource = FhirField( title="Medication Request Resource", resource_type="MedicationRequest", fhir_release="R4", )
class IWorkflowBehavior(Interface): index_field("review_state", store=True, type="keyword") review_state = schema.Choice( readonly=True, title="Workflow review state", required=False, defaultFactory=DefaultReviewState(), source="worklow_states", ) history = schema.List( title="History list", readonly=True, required=False, defaultFactory=list, value_type=schema.JSONField(title="History element", schema=HISTORY_SCHEMA), )
class IExample(IResource): metadata('categories') index_field('categories', type='nested') categories = schema.List(title='categories', default=[], value_type=schema.JSONField(title='term', schema=TERM_SCHEMA)) textline_field = schema.TextLine(title='kk', widget='testing', required=False) text_field = schema.Text(required=False) dict_value = schema.Dict(key_type=schema.TextLine(), value_type=schema.TextLine(), required=False) datetime = schema.Datetime(required=False) write_permission(write_protected='example.MyPermission') write_protected = schema.TextLine( title='Write protected field', required=False, )
class IDublinCore(Interface): index_field("creators", type="keyword") index_field("tags", type="keyword") index_field("contributors", type="keyword") title = schema.TextLine( title="Title", description="The first unqualified Dublin Core 'Title' element value." ) description = schema.Text( title="Description", description="The first unqualified Dublin Core 'Description' element value." ) creation_date = schema.Datetime( title="Creation Date", description="The date and time that an object is created. " "\nThis is normally set automatically.", ) modification_date = schema.Datetime( title="Modification Date", description="The date and time that the object was last modified in a\n" "meaningful way.", ) effective_date = schema.Datetime( title="Effective Date", description="The date and time that an object should be published. " ) expiration_date = schema.Datetime( title="Expiration Date", description="The date and time that the object should become unpublished." ) creators = schema.Tuple( title="Creators", description="The unqualified Dublin Core 'Creator' element values", value_type=schema.TextLine(), required=False, naive=True, max_length=1000, ) tags = PatchField( schema.Tuple( title="Tags", description="The unqualified Dublin Core 'Tags' element values", value_type=schema.TextLine(), required=False, naive=True, max_length=10000, ) ) publisher = schema.Text( title="Publisher", description="The first unqualified Dublin Core 'Publisher' element value." ) contributors = schema.Tuple( title="Contributors", description="The unqualified Dublin Core 'Contributor' element values", value_type=schema.TextLine(), required=False, naive=True, max_length=10000, )
class ISegmentEffort(IItem): metadata("id_strava") index_field("id_strava", type="text") id_strava = schema.TextLine(title="Strava id") metadata("name") index_field("name", type="text") name = schema.TextLine(title="Name") metadata("activity") index_field("activity", type="text") activity = schema.TextLine(title="Activity") metadata("segment") index_field("segment", type="text") segment = schema.TextLine(title="Segment") metadata("elapsed_time") index_field("elapsed_time", type="int") elapsed_time = schema.Int(title="Elapsed time") metadata("moving_time") index_field("moving_time", type="int") moving_time = schema.Int(title="Moving time") metadata("start_date") index_field("start_date", type="date") start_date = schema.Datetime(title="Start date") metadata("start_date_local") index_field("start_date_local", type="date") start_date_local = schema.Datetime(title="Start date local") metadata("distance") index_field("distance", type="float") distance = schema.Float(title="Distance") start_index = schema.Float(title="Start index") end_index = schema.Float(title="End index") metadata("average_cadence") index_field("average_cadence", type="float") average_cadence = schema.Float(title="Average cadence") metadata("average_heartrate") index_field("average_heartrate", type="float") average_heartrate = schema.Float(title="Average heartrate") metadata("max_heartrate") index_field("max_heartrate", type="int") max_heartrate = schema.Int(title="Max heartrate") metadata("device_watts") index_field("device_watts", type="boolean") device_watts = schema.Bool(title="Device watts") metadata("average_watts") index_field("average_watts", type="float") average_watts = schema.Float(title="Average watts")
class IA(Interface): index_field("item", field_mapping={"type": "integer"}) item = Int()
class IC(Interface): index_field("item", field_mapping={"type": "float"}) item = Float()
class IMessage(IItem): index_field("text", type="text") text = schema.Text(required=True)
class IConversation(IFolder): index_field("users", type="keyword") users = schema.List(value_type=schema.TextLine(), default=list())
class ILink(IItem): index_field('url', type='text') url = schema.TextLine(title=_('URL'), required=False)
class IActivity(IFolder): metadata("id_strava") index_field("id_strava", type="text") id_strava = schema.TextLine(title="Strava id") metadata("name") index_field("name", type="text") name = schema.TextLine(title="Name") metadata("distance") index_field("distance", type="float") distance = schema.Int(title="Distance") metadata("moving_time") index_field("moving_time", type="int") moving_time = schema.Int(title="Moving time") elapsed_time = schema.Int(title="Elapsed time") metadata("total_elevation_gain") index_field("total_elevation_gain", type="int") total_elevation_gain = schema.Int(title="Total elevation gain") metadata("type_activity") index_field("type_activity", type="text") type_activity = schema.TextLine(title="Type") # Pass to vocabulary metadata("start_date") index_field("start_date", type="date") start_date = schema.Datetime(title="Start date") start_date_local = schema.Datetime(title="Start date local") timezone = schema.TextLine(title="Timezone") utc_offset = schema.Int(title="Utc offset") metadata("average_speed") index_field("average_speed", type="float") average_speed = schema.Float(title="Averge speed") metadata("max_speed") index_field("max_speed", type="float") max_speed = schema.Float(title="Max speed") metadata("average_cadence") index_field("average_cadence", type="float") average_cadence = schema.Float(title="Average cadence") metadata("average_watts") index_field("average_watts", type="float") average_watts = schema.Float(title="Average watts") metadata("weighted_average_watts") index_field("weighted_average_watts", type="float") weighted_average_watts = schema.Float(title="Weighted average watts") metadata("kilojoules") index_field("kilojoules", type="float") kilojoules = schema.Float(title="Kilojoules") metadata("device_watts") index_field("device_watts", type="boolean") device_watts = schema.Bool(title="Device watts") metadata("max_watts") index_field("max_watts", type="float") max_watts = schema.Float(title="Max watts") metadata("average_heartrate") index_field("average_heartrate", type="float") average_heartrate = schema.Float(title="Average heartrate") metadata("max_heartrate") index_field("max_heartrate", type="int") max_heartrate = schema.Int(title="Max heartrate") elev_high = schema.Float(title="Elev high") elev_low = schema.Float(title="Elev low") calories = schema.Float(title="Calories")
class ILink(IItem): index_field("url", store=True, type="text") url = schema.TextLine(title=_("URL"), required=False)