Exemple #1
0
         label=_("Sampling Frequency"),
         description=
         _("If a sample is taken periodically at this sample point, enter frequency here, e.g. weekly"
           ),
     ),
 ),
 ReferenceField(
     'SampleTypes',
     required=0,
     multiValued=1,
     allowed_types=('SampleType', ),
     vocabulary='SampleTypesVocabulary',
     relationship='SamplePointSampleType',
     widget=brw(
         label=_("Sample Types"),
         description=_("The list of sample types that can be collected "
                       "at this sample point.  If no sample types are "
                       "selected, then all sample types are available."),
     ),
 ),
 ComputedField('SampleTypeTitle',
               expression="[o.Title() for o in context.getSampleTypes()]",
               widget=ComputedWidget(visible=False, )),
 BooleanField(
     'Composite',
     default=False,
     widget=BooleanWidget(
         label=_("Composite"),
         description=
         _("Check this box if the samples taken at this point are 'composite' "
           "and put together from more than one sub sample, e.g. several surface "
           "samples from a dam mixed together to be a representative sample for the dam. "
            description =_(
                "The default container type. New sample partitions "
                "are automatically assigned a container of this "
                "type, unless it has been specified in more details "
                "per analysis service"),
        ),
    ),
    ReferenceField('SamplePoints',
        required = 0,
        multiValued = 1,
        allowed_types = ('SamplePoint',),
        vocabulary = 'SamplePointsVocabulary',
        relationship = 'SampleTypeSamplePoint',
        widget = brw(
            label=_("Sample Points"),
            description =_("The list of sample points from which this sample "
                           "type can be collected.  If no sample points are "
                           "selected, then all sample points are available."),
        ),
    ),
    ComputedField(
        'SamplePointTitle',
        expression="[o.Title() for o in context.getSamplePoints()]",
        widget = ComputedWidget(
            visibile=False,
        )
    ),
))

schema['description'].schemata = 'default'
schema['description'].widget.visible = True
Exemple #3
0
            description=_("The default container type. New sample partitions "
                          "are automatically assigned a container of this "
                          "type, unless it has been specified in more details "
                          "per analysis service"),
        ),
    ),
    ReferenceField(
        'SamplePoints',
        required=0,
        multiValued=1,
        allowed_types=('SamplePoint', ),
        vocabulary='SamplePointsVocabulary',
        relationship='SampleTypeSamplePoint',
        widget=brw(
            label=_("Sample Points"),
            description=_("The list of sample points from which this sample "
                          "type can be collected.  If no sample points are "
                          "selected, then all sample points are available."),
        ),
    ),
    ComputedField('SamplePointTitle',
                  expression="[o.Title() for o in context.getSamplePoints()]",
                  widget=ComputedWidget(visibile=False, )),
))

schema['description'].schemata = 'default'
schema['description'].widget.visible = True


class SampleType(BaseContent, HistoryAwareMixin):

    implements(ISampleType)
 DurationField('SamplingFrequency',
     vocabulary_display_path_bound=sys.maxint,
     widget=DurationWidget(
         label=_("Sampling Frequency"),
         description=_("If a sample is taken periodically at this sample point, enter frequency here, e.g. weekly"),
     ),
 ),
 ReferenceField('SampleTypes',
     required = 0,
     multiValued = 1,
     allowed_types = ('SampleType',),
     vocabulary = 'SampleTypesVocabulary',
     relationship = 'SamplePointSampleType',
     widget = brw(
         label=_("Sample Types"),
         description =_("The list of sample types that can be collected "
                        "at this sample point.  If no sample types are "
                        "selected, then all sample types are available."),
     ),
 ),
 ComputedField(
     'SampleTypeTitle',
     expression="[o.Title() for o in context.getSampleTypes()]",
     widget = ComputedWidget(
         visible=False,
     )
 ),
 BooleanField('Composite',
     default=False,
     widget=BooleanWidget(
         label=_("Composite"),
         description =_(
                       "per analysis service"),
     ),
 ),
 ReferenceField(
     'SamplePoints',
     required=0,
     multiValued=1,
     allowed_types=('SamplePoint', ),
     relationship='SampleTypeSamplePoint',
     widget=brw(
         label=_("Sample Points"),
         description=_("The list of sample points from which this sample "
                       "type can be collected.  If no sample points are "
                       "selected, then all sample points are available."),
         catalog_name='bika_setup_catalog',
         base_query={
             "is_active": True,
             "sort_on": "sortable_title",
             "sort_order": "ascending"
         },
         showOn=True,
     ),
 ),
 ComputedField('SamplePointTitle',
               expression="[o.Title() for o in context.getSamplePoints()]",
               widget=ComputedWidget(visibile=False, )),
 RecordsField(
     'AdmittedStickerTemplates',
     subfields=(
         'admitted',
         SMALL_DEFAULT_STICKER,