def checkCoverImage(image): """Check Image height:width is 1:1.8 """ imageSize = image.getImageSize() if imageSize[0] == 720 and imageSize[1] == 300: return True raise Invalid(_(u"Wrong! Image Size must be 720X300(W:H)"))
def checkImage1_1(image): """Check Image width:height is 2:1 """ # 暫時先不對子計畫logo做檢查 return True imageSize = image.getImageSize() if imageSize[0] == 2 * imageSize[1]: return True raise Invalid(_(u"Wrong! width:height must be 2:1."))
def title(self): return _(u"SchoolSearch")
# -*- coding: utf-8 -*- from artistic.content import _ from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm # 可設定年份 SETTABLE_YEARS = SimpleVocabulary( [SimpleTerm(value=u'2016', title=_(u'2016')), SimpleTerm(value=u'2017', title=_(u'2017')), SimpleTerm(value=u'2018', title=_(u'2018')), SimpleTerm(value=u'2019', title=_(u'2019')), SimpleTerm(value=u'2020', title=_(u'2020')),] ) # 設備分類 DEVICE_CLASSFICATION = SimpleVocabulary( [SimpleTerm(value=u'basic device', title=_(u'Basic Device')), SimpleTerm(value=u'extension device', title=_(u'Extension Device')),] ) # 藝才類別 ART_CLASSFICATION = SimpleVocabulary( [SimpleTerm(value=u"Artistic Class", title=_(u'artistic class')), SimpleTerm(value=u"Music Class", title=_(u'music class')), SimpleTerm(value=u"Dance Class", title=_(u'dance class')),] ) # 公立或私立學校 PUBLIC_OR_PRIVATE = SimpleVocabulary( [SimpleTerm(value=u'public school', title=_(u'Public School')), SimpleTerm(value=u'private school', title=_(u'Private School')),] )