class IHeldPosition(model.Schema, IContactContent): """Interface for HeldPosition content type""" position = ContactChoice( title=_("Organization/Position"), source=ContactSourceBinder(portal_type=("organization", "position")), required=True, ) label = schema.TextLine(title=_("Additional label"), description=_("Additional label with information that does not appear on position label"), required=False) start_date = schema.Date( title=_("Start date"), required=False, ) end_date = schema.Date( title=_("End date"), required=False, ) photo = NamedImage( title=_("Photo"), required=False, readonly=True, ) def get_person(): """Returns the person who holds the position """ def get_position(): """Returns the position (if position field is a position) """ def get_organization(): """Returns the first organization related to HeldPosition
class IProblema(form.Schema): title = schema.TextLine( title=_(u"Assumpte"), required=True, ) description = schema.Text( title=_(u"Descripció"), required=False, ) data_creacio = schema.Date( title=_(u"Data de creació"), required=False, ) url = schema.TextLine( title=_(u"URL"), description=_( u"Direcció URL amb informació addicional sobre el problema"), required=False) data_resolucio = schema.Date( title=_(u"Data estimada de resolució"), required=False, )
class IUser(form.Schema): '''Representa a un usuario para las vista de creacion, edicion y despliegue''' givenName = schema.TextLine(title=_(u'Primer Nombre'), ) givenName2 = schema.TextLine( title=_(u'Segundo Nombre'), required=False, ) sn = schema.TextLine(title=_(u'Primer Apellido'), ) sn2 = schema.TextLine( title=_(u'Segundo Apellido'), required=False, ) accClass = schema.TextLine(title=_(u'Clasificacion del Usuario'), ) uid = schema.TextLine(title=_(u'Login'), required=False) uniqueIdentifier = schema.TextLine( title=_(u'Cedula de Identidad'), description=_(u'Ej. V11222333'), ) dateCreation = schema.Date(title=_(u'Fecha de Creacion'), ) dateExpiration = schema.Date(title=_(u'Fecha de Expiracion'), )
class IOutcomecc(model.Schema): """ OutcomeCC Generic """ directives.mode(title='hidden') title = schema.TextLine( title=_(u"Title"), required=True, ) description = schema.Text( title=_(u'Summary'), required=False, missing_value=u'', ) baseline = schema.TextLine( title=_(u"Baseline"), required=True, ) baseline_date = schema.Date(title=_(u'Baseline date'), required=True) objective = schema.Text( title=_(u"Objective"), required=False, ) objective_date = schema.Date(title=_(u"Objective date"), required=False) stage = schema.TextLine( title=_(u"Stage"), required=False, )
class IGN6UrlHelperForm(Interface): """Define the fields for the link builder form""" equipResolutor = schema.TextLine( title=_(u"Equip resolutor"), description=_(u"Equip encarregat de resoldre el tiquet."), required=False ) producte = schema.TextLine( title=_(u"Codi del producte/servei"), description=_(u"Identificador del producte/servei al gestor."), required=False ) subservei = schema.TextLine( title=_(u"Codi del subservei"), description=_(u"Identificador del subservei al gestor."), required=False ) dataInici = schema.Date( title=_(u"Data d'inici"), description=_(u"Data en la que es podrà comenaçar a sol·licitar el servei."), required=False ) dataFi = schema.Date( title=_(u"Data fi"), description=_(u"Data del darrer dia que es podrà sol·licitar el servei."), required=False )
class IBadgeMembership(ITeamMembership): # hide default workspace fields form.omitted('groups') form.omitted('position') assigned = schema.Date( title=u'Date Assigned', required=True, defaultFactory=date.today, ) form.widget('assigned', DateFieldWidget) assigned_by = schema.TextLine( title=u'Assigned By', description=u'Enter your name or the person who approved adding ' u'this person to this badge.', required=False, defaultFactory=default_assigned_by, ) expires = schema.Date( title=u'Expiration Date', required=False, ) form.widget('expires', DateFieldWidget) notes = schema.Text( title=u'Notes', description=u"Optional. Enter any pertinent info about this " u"person's badge record.", required=False, )
class IIteration(model.Schema): start = schema.Date(title=_(u"Start")) end = schema.Date(title=_(u"End")) estimate = schema.Decimal(title=_(u"Estimate (man days)"), required=False, default=Decimal('0.00'))
class ISaveReportForm(interface.Interface): start_date = schema.Date( title=_(u"Date"), description=_(u"Choose a starting date for this report"), required=True) end_date = schema.Date( title=_(u"Date"), description=_(u"Choose an end date for this report"), required=True) note = schema.TextLine(title=u"Note", required=False, description=u"Optional note regarding this report" ) short_name = schema.TextLine(title=u"Report Type", required=True, description=u"Report Type" ) body_text = schema.Text(title=u"Report Text", required=True, description=u"Report Type" ) sittings = schema.TextLine( title=_(u"Sittings included in this report"), description=_(u"Sittings included in this report"), required=False )
class IVeracisRunBase(BaseModel): """Object that will be the base of all veracis runs """ run_number = schema.Int( title=_(u"Veracis Run Number"), description=_(u"Veracis Run Number"), required=True, ) run_planner = schema.TextLine( title=_(u"Veracis Run Planner"), description=_(u"Veracis Run Operator"), required=True, ) run_operator = schema.TextLine( title=_(u"Veracis Run Operator"), description=_(u"Veracis Run Operator"), required=True, ) run_date = schema.Date( title=_(u"Veracis Test Run Date"), description=_(u"Veracis Test Run Date (MM/DD/YYYY)"), default=date.today(), ) test_scan_date = schema.Date( title=_(u"Veracis Test Scan Date"), description=_(u"Veracis Test Scan Date (MM/DD/YYYYY)"), default=date.today(), ) pdf_veracis_run = NamedBlobImage( title=_(u"PDF Upload of Test Form"), description=_(u"PDF Upload of Test Form"), required=False, )
class IQuizInformation(Interface): """Information concerning a student """ quiz_id = schema.Int( title=_(u"Quiz identifier"), description=_(u"A unique id for a question requested by a student."), required=True, readonly=True) studentinformation = schema.Object(title=_(u"Student"), schema=IStudentInformation, required=True, readonly=True) questioninformation = schema.Object(title=_(u"Question"), schema=IQuestionInformation, required=True, readonly=True) quiz_location = schema.TextLine(title=_(u"Lecture Url"), ) quiz_time = schema.Date(title=_(u"Date/Time when question requested"), ) student_answer = schema.Int( title=_(u"Id of student answer"), description=_(u"Id of the answer the student gave."), ) answertime = schema.Date(title=_(u"Date/Time when question answered"), )
class IAssayRequest(BaseModel): """Object that will be attached to sample. It will be the instance object that has a workflow that can be tracked in the LIMS. """ assay_name = schema.Choice( title=_(u"Assay Name"), description=_(u"Assay Name"), source=IChipAssayListVocabulary, required=True, ) date_ordered = schema.Date( title=_(u"Date Ordered"), description=_(u"Date Ordered"), defaultFactory=currentDate, required=True, ) date_resulted = schema.Date( title=_(u"Assay Result Date"), description=_(u"Assay Result Date"), required=False, ) aliquot_evaluated = schema.TextLine( title=_(u"Aliquot ID Used For Assay Request"), description=_(u"Aliquot ID Used For Assay Request"), required=False, ) comment = schema.Text( title=_(u"Any Notes or Comments About the Assay Request"), description=_(u"Any Notes or Comments About the Assay Request"), required=False, )
class ICourse(Interface): """A Course """ #containers('.ICourseFolder') title = schema.TextLine(title=_(u"Course title"), required=True) description = schema.TextLine( title=_(u"Description"), description=_(u"Plain-text blurb about the course")) course_code = schema.ASCIILine( title=_(u"Course Code"), description=_( u"This should match the course code used by the booking system"), required=True) objetives = schema.SourceText(title=_(u"Objetives"), description=_(u"A objetives of the course"), required=True) start_date = schema.Date( title=_(u"Visible from"), description=_(u"Date when course first appears on the website")) end_date = schema.Date( title=_(u"Visible until"), description=_(u"Date when course last appears on the website")) category = schema.TextLine(title=_(u"Category"), required=True)
class IGraphBehavior(form.Schema): """ Fields to construct text to use in graph application""" dtype = schema.Choice( title=u'type', required=True, values=( "salt", "fluorescens", "oxygene", "temp", "turbidity", ), ) date1 = schema.Date( defaultFactory=theDefaultValue, min=datetime.date(2015, 5, 12), max=datetime.date.today(), ) date2 = schema.Date( defaultFactory=theDefaultValue, min=datetime.date(2015, 5, 12), max=datetime.date.today(), ) form.mode(plotly_html='hidden') plotly_html = schema.Text( title=u'Plotly html', default=u'Ingen relevante data ble funnet hos Gabriel', required=False, )
class IOtherName(model.Schema): """ Marker interface and Dexterity Python Schema for OtherName Used for Persons """ # If you want, you can load a xml model created TTW here # and customize it in Python: # model.load('other_name.xml') dexteritytextindexer.searchable('name') name = schema.TextLine( title=_(u'Name'), required=False, ) dexteritytextindexer.searchable('note') note = schema.Text( title=_(u'Note'), description=_(u'Birth name'), required=False, ) start_date = schema.Date( title=_(u'Start Date'), required=False, ) end_date = schema.Date( title=_(u'End Date'), required=False, )
class IRepositoryRoot(model.Schema): """ Repository root marker / schema interface """ model.fieldset( u'common', label=bmf(u'fieldset_common', default=u'Common'), fields=[ 'valid_from', 'valid_until', 'version', ], ) valid_from = schema.Date( title=_(u'label_valid_from', default=u'Valid from'), required=False, ) valid_until = schema.Date( title=_(u'label_valid_until', default=u'Valid until'), required=False, ) version = schema.TextLine( title=_(u'label_version', default=u'Version'), required=False, )
class ITimeSeriesCollection(IDataCollection): """ Time series interface for configured range of time for all data series contained. Adds date range configuration to collection. """ start = schema.Date( title=_(u'Start date'), required=False, ) end = schema.Date( title=_(u'End date'), required=False, ) frequency = schema.Choice( title=u'Chart frequency', vocabulary=FREQ_VOCAB, default='monthly', ) @invariant def validate_start_end(obj): if not (obj.start is None or obj.end is None) and obj.start > obj.end: raise Invalid(_(u"Start date cannot be after end date."))
class ISearchAndReserveForm(model.Schema): """ Search form for search & reserve view. """ form.mode(timeframes='hidden') timeframes = schema.Text(title=_(u'Timeframes'), default=u'', required=False) recurrence_start = schema.Date(title=_(u"Start date"), required=True) recurrence_end = schema.Date(title=_(u"End date"), required=True) whole_day = schema.Bool(title=_(u"Whole day"), required=False, default=False) start_time = schema.Time(title=_(u"Start time"), required=False) end_time = schema.Time(title=_(u"End time"), required=False) form.widget(days=CheckBoxFieldWidget) days = schema.List(title=_(u"Days"), value_type=schema.Choice(vocabulary=weekdays), required=False) minspots = schema.Int(title=_(u"Spots"), required=False) available_only = schema.Bool(title=_(u"Available only"), required=False, default=True)
class IWorkshop(Interface): """Workshop """ code = schema.TextLine( title=_(u'label_cmo_workshop_code', u'Workshop ID'), required=False, ) # form.mode(title='hidden') title = schema.TextLine( title=_(u'label_cmo_workshop_name', u'Workshop Name'), required=False, ) short_name = schema.TextLine( title=_(u'Shortname'), required=False, ) start_date = schema.Date( title=_(u'label_cmo_workshop_start_date', u'Workshop Start Date'), required=False, ) end_date = schema.Date( title=_(u'label_cmo_workshop_end_date', u'Workshop End Date'), required=False, ) event_type = schema.TextLine( title=_(u'label_cmo_workshop_type', u'Workshop Type'), required=False, ) max_participants = schema.Int( title=_(u'label_cmo_workshop_max_participants', u'Maximum Number of Participants'), required=False, ) description = schema.Text( title=_(u'label_cmo_workshop_description', u'Workshop Description'), required=False, ) press_release = RichText( title=_(u'label_cmo_workshop_press_release', u'Press Release'), required=False, ) @invariant def validate_start_end(data): if (data.start_date and data.end_date and data.start_date > data.end_date): raise StartBeforeEnd( _('error_end_must_be_after_start_date', default=u'End date must be after start date.'))
class IPeriod(model.Schema): """ Marker interface and Dexterity Python Schema for Period """ start = schema.Date(title=_(u"Start date")) end = schema.Date(title=_(u"End date")) nb_places = schema.Int(title=_(u"Number of total available places"))
class IAssignment(IAlchemistContent): content = schema.Object(IAlchemistContent) context = schema.Object(IAlchemistContent) title = schema.TextLine(title=_(u"Name of the Assignment")) start_date = schema.Date(title=_(u"Start Date of the Assignment")) end_date = schema.Date(title=_(u"End Date of the Assignment")) type = schema.TextLine(title=_(u"Assignment Type"), readonly=True) status = schema.TextLine(title=_(u"Status"), readonly=True) notes = schema.Text(title=_(u"Notes"), description=_(u"Notes"))
class IDateRangeSchema(interface.Interface): range_start_date = schema.Date( title=_(u"From"), description=_(u"Leave blank or set lower limit"), required=False) range_end_date = schema.Date( title=_(u"To"), description=_(u"Leave blank or set upper limit"), required=False)
class ITaskTransitionResponseFormSchema(Interface): """Schema-interface class for the task transition response form """ transition = schema.Choice( title=_("label_transition", default="Transition"), source=util.getTransitionVocab, required=False, ) text = schema.Text( title=_('label_response', default="Response"), required=False, ) date_of_completion = schema.Date( title=_(u"label_date_of_completion", default=u"Date of completion"), description=_(u"help_date_of_completion", default=u""), required=False, ) relatedItems = RelationList( title=_(u'label_related_items', default=u'Related Items'), default=[], missing_value=[], value_type=RelationChoice( title=u"Related", source=DossierPathSourceBinder( portal_type=("opengever.document.document", "ftw.mail.mail"), ), ), required=False, ) reminder_option = schema.Choice( title=_("label_reminder", default="Reminder"), description=_("help_reminder", default="Set a reminder to get notified based on " "the duedate"), source="opengever.task.reminder.TaskReminderOptionsVocabulary", required=False, defaultFactory=get_current_user_reminder) reminder_option_date = schema.Date(title=_(u"lable_reminder_choose_date", default=u"Choose remind date"), required=False, defaultFactory=get_remind_on_date) @invariant def reminder_option_date_validator(data): if data.reminder_option == ReminderOnDate.option_type and \ not data.reminder_option_date: raise Invalid( _(u'no_remind_date_error', default=u'Please choose a remind date'))
class IAssignment(IAlchemistContent): content = schema.Object(IAlchemistContent) context = schema.Object(IAlchemistContent) title = schema.TextLine( title=_(u"Title of document assignment to group or committee")) start_date = schema.Date(title=_(u"Start date of document assignment")) end_date = schema.Date(title=_(u"End date of document assignment")) type = schema.TextLine(title=_(u"Document assignment type"), readonly=True) status = schema.TextLine(title=_(u"Status"), readonly=True) notes = schema.Text(title=_(u"Notes"), description=_(u"Notes"))
class IMappaSimulazione(model.Schema): """ Marker interface and Dexterity Python Schema for MappaSimulazione """ # If you want, you can load a xml model created TTW here # and customize it in Python: # model.load('mappa_simulazione.xml') # directives.widget(level=RadioFieldWidget) # level = schema.Choice( # title=_(u'Sponsoring Level'), # vocabulary=LevelVocabulary, # required=True # ) # text = RichText( # title=_(u'Text'), # required=False # ) # url = schema.URI( # title=_(u'Link'), # required=False # ) # fieldset('Images', fields=['logo', 'advertisement']) # logo = namedfile.NamedBlobImage( # title=_(u'Logo'), # required=False, # ) start = schema.Date( title=u'First day of the conference', required=False, default=date(2019, 10, 21), ) end = schema.Date( title=u'First day of the conference', required=False, default=date(2019, 10, 21), ) file_simulazione = namedfile.NamedBlobFile( title=_(u'File di simulazione (file SWMM5)'), required=True, ) directives.read_permission(notes='cmf.ManagePortal') directives.write_permission(notes='cmf.ManagePortal') notes = RichText( title=_(u'Secret Notes (only for site-admins)'), required=False )
class IBookingRequestForm(IRequestForm): """ Define form fields """ start = schema.Date( title=_(u'Start of booking'), defaultFactory=start_default_value, ) end = schema.Date( title=_(u'End of booking'), defaultFactory=end_default_value, )
class IBooking(model.Schema): """ Marker interface for Booking """ title = schema.TextLine( title=_(u"Customer's name"), required=False, ) start = schema.Date(title=_(u'Start of booking'), ) end = schema.Date(title=_(u'End of booking'), )
class IPeriodicSeries(form.Schema): """Definition of a sequence of periods of time""" frequency = schema.Choice( title=_(u'Frequency'), description=_(u'Frequency of form collection.'), vocabulary=mkvocab(( 'Monthly', 'Quarterly', 'Weekly', 'Annual', 'Twice monthly', 'Every two months', 'Every other month', 'Every six months', 'Daily', )), default='Monthly', ) start = schema.Date( title=_(u'Start date'), description=_(u'Start date for series.'), required=False, ) end = schema.Date( title=_(u'End date'), description=_(u'End date for series.'), required=False, ) active_weekdays = schema.List( title=_(u'Active weekdays'), description=_(u'Working or active days of week; the first and last ' u'of which are considered when computing reporting ' u'periods for populating forms of weekly frequency ' u'(safely ignored for any non-weekly frequencies). ' u'Please note: days of week must be in sequential ' u'order.'), value_type=schema.Choice(vocabulary=mkvocab(( 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', )), ), constraint=DOW.validate, # any seven days must be in sequence! defaultFactory=DOW.weekdays, # requires zope.schema >= 3.8.0 required=False, )
class ICertifiedSignaturesRowSchema(Interface): """Schema for DataGridField widget's row of field 'certified_signatures'.""" signature_number = schema.Choice( title=_("Certified signatures signature number"), description=_( "Select the signature number, keep signatures ordered by number."), vocabulary='Products.PloneMeeting.vocabularies.numbersvocabulary', required=True, ) name = schema.TextLine( title=_(u'Certified signatures signatory name'), description=_( "Name of the signatory (for example 'Mister John Doe')."), required=False, ) function = schema.TextLine( title=_(u"Certified signatures signatory function"), description=_("Function of the signatory (for example 'Mayor')."), required=False, ) held_position = schema.Choice( title=_("Certified signatures held position"), description= _("Select a held position if necessary, 'Name', 'Function' and other data of this " "held position will be used if you leave 'Name' and 'Function' columns empty." ), vocabulary= 'Products.PloneMeeting.vocabularies.selectableassemblymembersvocabulary', required=False, ) date_from = schema.Date( title=_("Certified signatures valid from (included)"), description=_( "Enter valid from date, use following format : YYYY/MM/DD, " "leave empty so it is always valid."), required=False, default=None, ) date_to = schema.Date( title=_("Certified signatures valid to (included)"), description=_( "Enter valid to date, use following format : YYYY/MM/DD, " "leave empty so it is always valid."), required=False, default=None, )
class IComment(Interface): """A comment. Comments are indexed in the catalog and subject to workflow and security. """ portal_type = schema.ASCIILine( title=_(u'Portal type'), default='Discussion Item', ) __parent__ = schema.Object( title=_(u'Conversation'), schema=Interface) __name__ = schema.TextLine(title=_(u'Name')) comment_id = schema.Int( title=_(u'A comment id unique to this conversation')) in_reply_to = schema.Int( title=_(u'Id of comment this comment is in reply to'), required=False, ) # for logged in comments - set to None for anonymous author_username = schema.TextLine(title=_(u'Name'), required=False) # for anonymous comments only, set to None for logged in comments author_name = schema.TextLine(title=_(u'Name'), required=False) author_email = schema.TextLine(title=_(u'Email'), required=False) title = schema.TextLine(title=_(u'label_subject', default=u'Subject')) mime_type = schema.ASCIILine(title=_(u'MIME type'), default='text/plain') text = schema.Text( title=_( u'label_comment', default=u'Comment' ) ) user_notification = schema.Bool( title=_( u'Notify me of new comments via email.' ), required=False ) creator = schema.TextLine(title=_(u'Username of the commenter')) creation_date = schema.Date(title=_(u'Creation date')) modification_date = schema.Date(title=_(u'Modification date'))
class IComment(Interface): """A comment. Comments are indexed in the catalog and subject to workflow and security. """ portal_type = schema.ASCIILine( title=_(u"Portal type"), default="Discussion Item", ) __parent__ = schema.Object( title=_(u"Conversation"), schema=Interface) __name__ = schema.TextLine(title=_(u"Name")) comment_id = schema.Int( title=_(u"A comment id unique to this conversation")) in_reply_to = schema.Int( title=_(u"Id of comment this comment is in reply to"), required=False, ) # for logged in comments - set to None for anonymous author_username = schema.TextLine(title=_(u"Name"), required=False) # for anonymous comments only, set to None for logged in comments author_name = schema.TextLine(title=_(u"Name"), required=False) author_email = schema.TextLine(title=_(u"Email"), required=False) title = schema.TextLine(title=_(u"label_subject", default=u"Subject")) mime_type = schema.ASCIILine(title=_(u"MIME type"), default="text/plain") text = schema.Text( title=_( u"label_comment", default=u"Comment" ) ) user_notification = schema.Bool( title=_( u"Notify me of new comments via email." ), required=False ) creator = schema.TextLine(title=_(u"Username of the commenter")) creation_date = schema.Date(title=_(u"Creation date")) modification_date = schema.Date(title=_(u"Modification date"))