Пример #1
0
    def editable_fields(self):
        '''
        a property called by dialogs which edit this class
        hence the order is important!
        a list of tuples.
        item0 in the tuple is the field name used by the db
        item) is the string displayed to the user.
        '''

        sex_field = EditableField('sex', _('Sex'), True)
        sex_field.set_type(SETTINGS.OM_TYPES['sex'])

        status_field = EditableField('status', _('Status'), True)
        status_field.set_type(SETTINGS.OM_TYPES['pt_status'])
        status_field.set_advanced(True)

        preferred_field = EditableField(
            'preferred_name', u"<i>%s</i>"% _("Preferred Name"))
        preferred_field.set_advanced(True)

        qualifications_field = EditableField(
            'qualifications', u"<i>%s</i>"% _("Qualifications"))
        qualifications_field.set_advanced(True)

        return [
        EditableField('title', _("Title"), required=True),
        EditableField('first_name', _("First Name"), True),
        EditableField('last_name', _("Surname"), True),
        preferred_field,
        qualifications_field,
        EditableField('dob', _('Date of Birth'), True),
        sex_field,
        status_field
        ]
Пример #2
0
    def editable_fields(self):
        '''
        a property called by dialogs which edit this class
        hence the order is important!
        a list of tuples.
        item0 in the tuple is the field name used by the db
        item1 is the string displayed to the user.
        item3 is optional type
        '''
        if self._editable_fields is None:
            cat_field = EditableField('address_cat', _("Category"))
            cat_field.set_type(SETTINGS.OM_TYPES['address'])

            mail_field = EditableField('mailing', _('Mailing Preference'))
            mail_field.set_type(SETTINGS.OM_TYPES['mailing_pref'])
            mail_field.set_advanced()

            from_f = EditableField('from_date', _("Start Date for this address"))
            from_f.set_advanced()

            to_f = EditableField('to_date', _("Leaving Date for this address"))
            to_f.set_advanced()

            self._editable_fields = ([
                EditableField('addr1', _("Address Line 1"), required=True),
                EditableField('addr2', _("Address Line 2")),
                EditableField('addr3', _("Address Line 3")),
                EditableField('city', _('City'), required=True),
                EditableField('county', _('County')),
                EditableField('country', _('Country')),
                EditableField('postal_cd', _('Postal_cd'), required=True)],
                [cat_field,
                mail_field,
                from_f,
                to_f
                ])

        return self._editable_fields
Пример #3
0
    def editable_fields(self):
        '''
        a property called by dialogs which edit this class
        hence the order is important!
        a list of tuples.
        item0 in the tuple is the field name used by the db
        item1 is the string displayed to the user.
        item3 is optional type
        '''
        if self._editable_fields is None:
            cat_field = EditableField('address_cat', _("Category"))
            cat_field.set_type(SETTINGS.OM_TYPES['address'])

            mail_field = EditableField('mailing', _('Mailing Preference'))
            mail_field.set_type(SETTINGS.OM_TYPES['mailing_pref'])
            mail_field.set_advanced()

            from_f = EditableField('from_date',
                                   _("Start Date for this address"))
            from_f.set_advanced()

            to_f = EditableField('to_date', _("Leaving Date for this address"))
            to_f.set_advanced()

            self._editable_fields = ([
                EditableField('addr1', _("Address Line 1"), required=True),
                EditableField('addr2', _("Address Line 2")),
                EditableField('addr3', _("Address Line 3")),
                EditableField('city', _('City'), required=True),
                EditableField('county', _('County')),
                EditableField('country', _('Country')),
                EditableField('postal_cd', _('Postal_cd'), required=True)
            ], [cat_field, mail_field, from_f, to_f])

        return self._editable_fields