本文整理汇总了Python中model.Member.phone_home方法的典型用法代码示例。如果您正苦于以下问题:Python Member.phone_home方法的具体用法?Python Member.phone_home怎么用?Python Member.phone_home使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Member
的用法示例。
在下文中一共展示了Member.phone_home方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: task_member_restore
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import phone_home [as 别名]
def task_member_restore(items):
for item in items:
member = Member()
member.number = item['number']
member.address = item['address']
if item['email'] != '' and item['email'] != None:
member.email = db.Email(item['email'])
member.name = item['name']
member.member_since = string_to_date(item['memberSince'])
if item['phone'] != '' and item['phone'] != None:
member.phone = db.PhoneNumber(item['phone'])
if item['phoneWork'] != '' and item['phoneWork'] != None:
member.phone_work = item['phoneWork']
if item['phoneHome'] != '' and item['phoneHome'] != None:
member.phone_home = item['phoneHome']
member.notes = item['notes']
member.zipcode = item['zipcode']
member.city = item['city']
member.county = item['county']
member.country = db.get(db.Key.from_path('Country', item['countryId']))
member.status = db.get(db.Key.from_path('Status', item['statusId']))
member.membertype = db.get(db.Key.from_path('MemberType', item['typeId']))
member.put()
for itemdue in item['membershipDues']:
due = MembershipDues(parent=member, year=itemdue['year'],paid=itemdue['paid'])
due.put()
for itemcar in item['cars']:
car = Car()
car.member = member
car.registration = itemcar['registration']
car.model = db.get(db.Key.from_path('CarModel', itemcar['modelId']))
car.bought_year = itemcar['boughtYear']
car.sold_year = itemcar['soldYear']
car.year = itemcar['year']
car.notes = itemcar['notes']
car.serial_no = itemcar['serialNo']
car.put()
示例2: get
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import phone_home [as 别名]
def get(self):
config = Configuration()
ruler = """
--------------------------------------------------------------------------------
0________1_________2_________3_________4_________5_________6_________7_________8
1 0 0 0 0 0 0 0 0
--------------------------------------------------------------------------------
"""
template = Template(config.get('WELCOME_MAIL_TEXT'))
member = Member()
member.name = 'Ola Normann'
member.address = 'Norskeveien 1'
member.zipcode = '9876'
member.city = 'Olabyen'
member.country = Country().all().order('order').fetch(1)[0]
member.email = '[email protected]'
member.phone = '916 75 105'
member.phone_home = '939 90 115'
member.phone_work = '101 33 116'
member.number = '9669'
member.access_code = 'BBQWTF'
member.member_type = MemberType.all().order('order').fetch(1)[0]
sample_data = {
'year': 2014,
'fee': 400,
'account_no': config.get('GIRO_ACCOUNT_NO'),
'member': member,
'profile_url': constants.PROFILE_URL
}
sample_text = template.render(sample_data)
# Merge template before submitting text
data = {'text': ruler + sample_text + ruler }
template = JINJA_ENVIRONMENT.get_template('templates/settings/email_preview.html')
self.response.write(template.render(data))
示例3: post
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import phone_home [as 别名]
#.........这里部分代码省略.........
if mobile and mobile.strip() == '':
mobile = None
values['mobile'] = mobile
home = self.request.get('home')
if home and home.strip() == '':
home = None
values['home'] = home
work = self.request.get('work')
if work and work.strip() == '':
work = None
values['work'] = work
member_type = self.request.get('type')
if not member_type or member_type.strip() == '':
member_type = '1'
types = MemberType.all().fetch(100)
mtype = None
# TODO: Custom settings? Constants at least.
if member_type == '1':
mtype = next(t for t in types if t.name == DEFAULT_MEMBER_NAME)
else:
mtype = next(t for t in types if t.name == DEFAULT_SUPPORT_MEMBER_NAME)
values['type'] = mtype.name
comment = self.request.get('comment')
complete.append('comment')
values['comment'] = comment
error_message = ''
# Check if member exists;
existing = Member.all().filter('email', email).fetch(1)
if len(existing) > 0:
incomplete.append('email')
error_message = 'Det er allerede registrert noen i medlemsregisteret med denne epostadressen!'
# TODO: Error message
if len(incomplete) > 0:
# missing field, redirect to signup page again
template = JINJA_ENVIRONMENT.get_template('templates/selfservice/signup.html')
return self.response.write(template.render({
'countries': countries,
'incomplete': incomplete,
'complete': complete,
'error_message': error_message,
'values': values }))
# invariant: fields are OK, create new member, send mail,
# create payment history on member.
template = JINJA_ENVIRONMENT.get_template('templates/selfservice/signup_receipt.html')
data = {
'values': values,
'profile_url': PROFILE_URL
}
statuses = Status.all().fetch(100)
# TODO: Handle existing members signing up again
new_member = Member()
new_member.name = name
new_member.address = address
new_member.zipcode = zipcode
new_member.city = city
new_member.notes = comment
new_member.country = country
new_member.membertype = mtype
status = next(s for s in statuses if s.name == SIGNUP_STATUS_NAME)
new_member.status = status
new_member.number = dbutils.create_new_member_no()
new_member.email = email
new_member.member_since = datetime.date.today()
if mobile:
new_member.phone = mobile
if work:
new_member.phone_work = work
if home:
new_member.phone_home = home
new_member.generate_access_code()
new_member.member_since = datetime.date.today()
new_member.member_type = mtype
new_member.put()
self.send_welcome_mail(new_member)
self.send_notification_mails(new_member)
# TODO: Invalidate counts for categories
# Handle mutations on members gracefully
return self.response.write(template.render(data))
示例4: import_members
# 需要导入模块: from model import Member [as 别名]
# 或者: from model.Member import phone_home [as 别名]
def import_members(self, member_csv):
member_csv = member_csv.split('\n')
lines = self.unmangle(member_csv)
count = 0
for fields in lines:
#fields.reverse()
print '-'*80
print fields
print '='*80
fields.reverse()
member = Member()
(fee2009, fee2010, fee2011,
fee2012, fee2013, fee2014) = (
fields.pop(), fields.pop(), fields.pop(),
fields.pop(), fields.pop(), fields.pop())
member.address = fields.pop()
# Skip the cars
for carno in range(1,6):
(car, registration) = (fields.pop(), fields.pop())
email = fields.pop()
if email != '':
member.email = db.Email(email)
(lastname, firstname) = (fields.pop(), fields.pop())
full_name = firstname + ' ' + lastname
member.name = full_name.strip()
member.county = fields.pop().strip()
member_since = fields.pop()
date = self.string_to_date(member_since)
if date:
member.member_since = date
else:
print 'Error converting date from',member_since
country = fields.pop().strip()
if country == '':
country = 'Norge'
member.country = self.string_to_country(country)
member.membertype = self.string_to_type(fields.pop())
member.number = fields.pop()
mobile = fields.pop()
if mobile != '':
member.phone = db.PhoneNumber(mobile)
member.notes = fields.pop()
member.zipcode = fields.pop()
member.city = fields.pop()
work = fields.pop()
home = fields.pop()
if work != '':
member.phone_work = db.PhoneNumber(work)
if home != '':
member.phone_home = db.PhoneNumber(home)
member.status = self.get_status('Medlem')
member.generate_access_code()
member.put()
self.add_due(member, 2009, fee2009=='Betalt')
self.add_due(member, 2010, fee2010=='Betalt')
self.add_due(member, 2011, fee2011=='Betalt')
self.add_due(member, 2012, fee2012=='Betalt')
self.add_due(member, 2013, fee2013=='Betalt')
self.add_due(member, 2014, fee2014=='Betalt')
count = count + 1
print 'Imported',count,'members'