From e4f302b5d5537932964596cba74edb73eb0ddce5 Mon Sep 17 00:00:00 2001 From: Joshua Sangmeister Date: Mon, 5 Feb 2024 15:07:52 +0100 Subject: [PATCH] Add constant flag --- models.yml | 121 +++++++++++++++++++++++++++++++++++ models_validator/validate.py | 1 + 2 files changed, 122 insertions(+) diff --git a/models.yml b/models.yml index 4a3df669..215039d0 100644 --- a/models.yml +++ b/models.yml @@ -61,6 +61,7 @@ organization: id: type: number restriction_mode: A + constant: true name: type: string restriction_mode: A @@ -225,6 +226,7 @@ user: id: type: number restriction_mode: A + constant: true username: type: string required: true @@ -364,12 +366,14 @@ user: to: organization/user_ids required: True restriction_mode: F + constant: true meeting_user: id: type: number required: true restriction_mode: A + constant: true comment: type: HTMLStrict @@ -393,11 +397,13 @@ meeting_user: to: user/meeting_user_ids required: true restriction_mode: A + constant: true meeting_id: type: relation to: meeting/meeting_user_ids required: true restriction_mode: A + constant: true personal_note_ids: type: relation-list @@ -461,6 +467,7 @@ organization_tag: id: type: number restriction_mode: A + constant: true name: type: string required: True @@ -489,6 +496,7 @@ theme: restriction_mode: A type: number required: true + constant: true name: restriction_mode: A type: string @@ -643,11 +651,13 @@ theme: restriction_mode: A to: organization/theme_ids type: relation + constant: true committee: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -700,11 +710,13 @@ committee: to: organization/committee_ids required: true restriction_mode: A + constant: true meeting: id: type: number restriction_mode: A + constant: true external_id: type: string restriction_mode: A @@ -763,6 +775,7 @@ meeting: - ru - cs required: true + constant: true # Configuration (only for the server owner) jitsi_domain: @@ -1642,6 +1655,7 @@ meeting: to: committee/meeting_ids required: true restriction_mode: B + constant: true default_meeting_for_committee_id: type: relation to: committee/default_meeting_id @@ -1761,6 +1775,7 @@ group: id: type: number restriction_mode: A + constant: true external_id: type: string restriction_mode: A @@ -1885,11 +1900,13 @@ group: to: meeting/group_ids required: true restriction_mode: A + constant: true personal_note: id: type: number restriction_mode: A + constant: true note: type: HTMLStrict restriction_mode: A @@ -1903,6 +1920,7 @@ personal_note: equal_fields: meeting_id restriction_mode: A required: true + constant: true content_object_id: type: generic-relation to: @@ -1911,16 +1929,19 @@ personal_note: field: personal_note_ids equal_fields: meeting_id restriction_mode: A + constant: true meeting_id: type: relation to: meeting/personal_note_ids required: true restriction_mode: A + constant: true tag: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -1941,11 +1962,13 @@ tag: to: meeting/tag_ids required: true restriction_mode: A + constant: true agenda_item: id: type: number restriction_mode: A + constant: true item_number: type: string restriction_mode: A @@ -2000,6 +2023,7 @@ agenda_item: required: true equal_fields: meeting_id restriction_mode: A + constant: true parent_id: type: relation to: agenda_item/child_ids @@ -2026,11 +2050,13 @@ agenda_item: to: meeting/agenda_item_ids required: true restriction_mode: A + constant: true list_of_speakers: id: type: number restriction_mode: A + constant: true closed: type: boolean default: false @@ -2041,6 +2067,7 @@ list_of_speakers: read_only: true required: true restriction_mode: A + constant: true content_object_id: type: generic-relation @@ -2055,6 +2082,7 @@ list_of_speakers: required: true equal_fields: meeting_id restriction_mode: A + constant: true speaker_ids: type: relation-list to: speaker/list_of_speakers_id @@ -2072,11 +2100,13 @@ list_of_speakers: to: meeting/list_of_speakers_ids required: true restriction_mode: A + constant: true point_of_order_category: id: type: number restriction_mode: A + constant: true text: type: string required: true @@ -2090,6 +2120,7 @@ point_of_order_category: to: meeting/point_of_order_category_ids required: true restriction_mode: A + constant: true speaker_ids: type: relation-list to: speaker/point_of_order_category_id @@ -2100,6 +2131,7 @@ speaker: id: type: number restriction_mode: A + constant: true begin_time: type: timestamp read_only: true @@ -2126,6 +2158,7 @@ speaker: point_of_order: type: boolean restriction_mode: A + constant: true list_of_speakers_id: type: relation @@ -2133,11 +2166,13 @@ speaker: required: true equal_fields: meeting_id restriction_mode: A + constant: true meeting_user_id: type: relation to: meeting_user/speaker_ids equal_fields: meeting_id restriction_mode: A + constant: true point_of_order_category_id: type: relation to: point_of_order_category/speaker_ids @@ -2148,11 +2183,13 @@ speaker: to: meeting/speaker_ids required: true restriction_mode: A + constant: true topic: id: type: number restriction_mode: A + constant: true title: type: string required: true @@ -2166,6 +2203,7 @@ topic: read_only: true required: true restriction_mode: A + constant: true attachment_ids: type: relation-list @@ -2179,6 +2217,7 @@ topic: on_delete: CASCADE equal_fields: meeting_id restriction_mode: A + constant: true list_of_speakers_id: type: relation to: list_of_speakers/content_object_id @@ -2186,6 +2225,7 @@ topic: on_delete: CASCADE equal_fields: meeting_id restriction_mode: A + constant: true poll_ids: type: relation-list to: poll/content_object_id @@ -2203,11 +2243,13 @@ topic: to: meeting/topic_ids required: true restriction_mode: A + constant: true motion: id: type: number restriction_mode: A + constant: true number: type: string restriction_mode: C @@ -2222,6 +2264,7 @@ motion: read_only: true required: true restriction_mode: C + constant: true title: type: string required: true @@ -2423,6 +2466,7 @@ motion: on_delete: CASCADE equal_fields: meeting_id restriction_mode: C + constant: true tag_ids: type: relation-list to: tag/tagged_ids @@ -2450,11 +2494,13 @@ motion: to: meeting/motion_ids required: true restriction_mode: A + constant: true motion_submitter: id: type: number restriction_mode: A + constant: true weight: type: number restriction_mode: A @@ -2469,16 +2515,19 @@ motion_submitter: equal_fields: meeting_id restriction_mode: A required: true + constant: true meeting_id: type: relation to: meeting/motion_submitter_ids required: true restriction_mode: A + constant: true motion_comment: id: type: number restriction_mode: A + constant: true comment: type: HTMLStrict restriction_mode: A @@ -2489,22 +2538,26 @@ motion_comment: required: true equal_fields: meeting_id restriction_mode: A + constant: true section_id: type: relation to: motion_comment_section/comment_ids required: true equal_fields: meeting_id restriction_mode: A + constant: true meeting_id: type: relation to: meeting/motion_comment_ids required: true restriction_mode: A + constant: true motion_comment_section: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -2519,6 +2572,7 @@ motion_comment_section: read_only: true required: true restriction_mode: A + constant: true submitter_can_write: type: boolean restriction_mode: A @@ -2544,11 +2598,13 @@ motion_comment_section: to: meeting/motion_comment_section_ids required: true restriction_mode: A + constant: true motion_category: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -2571,6 +2627,7 @@ motion_category: read_only: true required: true restriction_mode: A + constant: true parent_id: type: relation @@ -2592,11 +2649,13 @@ motion_category: to: meeting/motion_category_ids required: true restriction_mode: A + constant: true motion_block: id: type: number restriction_mode: A + constant: true title: type: string required: true @@ -2610,6 +2669,7 @@ motion_block: read_only: true required: true restriction_mode: A + constant: true motion_ids: type: relation-list @@ -2640,11 +2700,13 @@ motion_block: to: meeting/motion_block_ids required: true restriction_mode: A + constant: true motion_change_recommendation: id: type: number restriction_mode: A + constant: true rejected: type: boolean default: false @@ -2687,16 +2749,19 @@ motion_change_recommendation: required: true equal_fields: meeting_id restriction_mode: A + constant: true meeting_id: type: relation to: meeting/motion_change_recommendation_ids required: true restriction_mode: A + constant: true motion_state: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -2829,11 +2894,13 @@ motion_state: to: meeting/motion_state_ids required: true restriction_mode: A + constant: true motion_workflow: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -2844,6 +2911,7 @@ motion_workflow: read_only: true required: true restriction_mode: A + constant: true state_ids: type: relation-list @@ -2874,11 +2942,13 @@ motion_workflow: to: meeting/motion_workflow_ids required: true restriction_mode: A + constant: true motion_statute_paragraph: id: type: number restriction_mode: A + constant: true title: type: string required: true @@ -2896,6 +2966,7 @@ motion_statute_paragraph: read_only: true required: true restriction_mode: A + constant: true motion_ids: type: relation-list @@ -2907,11 +2978,13 @@ motion_statute_paragraph: to: meeting/motion_statute_paragraph_ids required: true restriction_mode: A + constant: true poll: id: type: number restriction_mode: A + constant: true description: type: text restriction_mode: A @@ -3021,6 +3094,7 @@ poll: read_only: true required: true restriction_mode: A + constant: true crypt_key: type: string description: base64 public key to cryptographic votes. @@ -3052,6 +3126,7 @@ poll: equal_fields: meeting_id restriction_mode: A required: true + constant: true option_ids: type: relation-list to: option/poll_id @@ -3064,6 +3139,7 @@ poll: on_delete: CASCADE equal_fields: meeting_id restriction_mode: A + constant: true voted_ids: type: relation-list to: user/poll_voted_ids @@ -3084,11 +3160,13 @@ poll: to: meeting/poll_ids restriction_mode: A required: true + constant: true option: id: type: number restriction_mode: A + constant: true weight: type: number default: 10000 @@ -3111,11 +3189,13 @@ option: to: poll/option_ids equal_fields: meeting_id restriction_mode: A + constant: true used_as_global_option_in_poll_id: type: relation to: poll/global_option_id equal_fields: meeting_id restriction_mode: A + constant: true vote_ids: type: relation-list to: vote/option_id @@ -3130,26 +3210,32 @@ option: - poll_candidate_list/option_id equal_fields: meeting_id restriction_mode: A + constant: true meeting_id: type: relation to: meeting/option_ids required: true restriction_mode: A + constant: true vote: id: type: number restriction_mode: A + constant: true weight: type: decimal(6) restriction_mode: A + constant: true value: type: string restriction_mode: A + constant: true user_token: type: string required: true restriction_mode: B + constant: true option_id: type: relation @@ -3157,6 +3243,7 @@ vote: equal_fields: meeting_id required: true restriction_mode: A + constant: true user_id: type: relation to: user/vote_ids @@ -3170,11 +3257,13 @@ vote: to: meeting/vote_ids required: true restriction_mode: A + constant: true assignment: id: type: number restriction_mode: A + constant: true title: type: string required: true @@ -3207,6 +3296,7 @@ assignment: read_only: true required: true restriction_mode: A + constant: true candidate_ids: type: relation-list @@ -3233,6 +3323,7 @@ assignment: on_delete: CASCADE equal_fields: meeting_id restriction_mode: A + constant: true tag_ids: type: relation-list to: tag/tagged_ids @@ -3254,11 +3345,13 @@ assignment: to: meeting/assignment_ids required: true restriction_mode: A + constant: true assignment_candidate: id: type: number restriction_mode: A + constant: true weight: type: number default: 10000 @@ -3270,21 +3363,25 @@ assignment_candidate: equal_fields: meeting_id restriction_mode: A required: true + constant: true meeting_user_id: type: relation to: meeting_user/assignment_candidate_ids restriction_mode: A + constant: true meeting_id: type: relation to: meeting/assignment_candidate_ids required: true restriction_mode: A + constant: true # models for the poll list election poll_candidate_list: id: type: number restriction_mode: A + constant: true poll_candidate_ids: type: relation-list to: poll_candidate/poll_candidate_list_id @@ -3296,27 +3393,32 @@ poll_candidate_list: to: meeting/poll_candidate_list_ids required: true restriction_mode: A + constant: true option_id: type: relation to: option/content_object_id equal_fields: meeting_id required: true restriction_mode: A + constant: true poll_candidate: id: type: number restriction_mode: A + constant: true poll_candidate_list_id: type: relation to: poll_candidate_list/poll_candidate_ids equal_fields: meeting_id restriction_mode: A required: true + constant: true user_id: type: relation to: user/poll_candidate_ids restriction_mode: A + constant: true weight: type: number required: true @@ -3326,6 +3428,7 @@ poll_candidate: to: meeting/poll_candidate_ids required: true restriction_mode: A + constant: true # Mediafiles are delivered by the mediafile server with the URL # `/media//path` @@ -3333,6 +3436,7 @@ mediafile: id: type: number restriction_mode: A + constant: true title: type: string description: Title and parent_id must be unique. @@ -3413,6 +3517,7 @@ mediafile: - organization/mediafile_ids restriction_mode: A required: true + constant: true # Reverse relations for meetings, if a mediafile is used as a special resource used_as_logo_projector_main_in_meeting_id: @@ -3484,6 +3589,7 @@ projector: id: type: number restriction_mode: A + constant: true name: type: string restriction_mode: A @@ -3565,6 +3671,7 @@ projector: read_only: true required: true restriction_mode: A + constant: true current_projection_ids: type: relation-list @@ -3649,6 +3756,7 @@ projector: to: meeting/projector_ids restriction_mode: A required: true + constant: true # A projection is a M2M model between an element that is assigned to a # projector. This element can either be the current one projected, in the @@ -3659,6 +3767,7 @@ projection: id: type: number restriction_mode: A + constant: true options: type: JSON restriction_mode: A @@ -3710,16 +3819,19 @@ projection: equal_fields: meeting_id restriction_mode: A required: true + constant: true meeting_id: type: relation to: meeting/all_projection_ids required: true restriction_mode: A + constant: true projector_message: id: type: number restriction_mode: A + constant: true message: type: HTMLStrict restriction_mode: A @@ -3735,11 +3847,13 @@ projector_message: to: meeting/projector_message_ids restriction_mode: A required: true + constant: true projector_countdown: id: type: number restriction_mode: A + constant: true title: type: string required: true @@ -3779,11 +3893,13 @@ projector_countdown: to: meeting/projector_countdown_ids restriction_mode: A required: true + constant: true chat_group: id: type: number restriction_mode: A + constant: true name: type: string required: true @@ -3814,11 +3930,13 @@ chat_group: to: meeting/chat_group_ids required: true restriction_mode: A + constant: true chat_message: id: type: number restriction_mode: A + constant: true content: type: HTMLStrict required: true @@ -3832,16 +3950,19 @@ chat_message: to: meeting_user/chat_message_ids restriction_mode: A required: true + constant: true chat_group_id: type: relation to: chat_group/chat_message_ids restriction_mode: A required: true + constant: true meeting_id: type: relation to: meeting/chat_message_ids required: true restriction_mode: A + constant: true action_worker: id: diff --git a/models_validator/validate.py b/models_validator/validate.py index f7bc6685..5babff82 100644 --- a/models_validator/validate.py +++ b/models_validator/validate.py @@ -52,6 +52,7 @@ "calculated", "required", "read_only", + "constant", )