本文整理汇总了Python中members.models.Member.birth_date方法的典型用法代码示例。如果您正苦于以下问题:Python Member.birth_date方法的具体用法?Python Member.birth_date怎么用?Python Member.birth_date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类members.models.Member
的用法示例。
在下文中一共展示了Member.birth_date方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: len
# 需要导入模块: from members.models import Member [as 别名]
# 或者: from members.models.Member import birth_date [as 别名]
type = mtype,
first_name = fname,
last_name = lname,
birth_date = row['Birthdate'],
first_seen_date = row['Created On'],
last_seen_date = datetime.date.today(),
address = row['Address'],
city = row['City'],
postal_code = row['Postal Code'],
phone_number = row['Contact #'],
email = row['Email'],
emergency_contact = row['Emergency Contact'],
emergency_phone_number = row['Emergency Phone'],
stripe_customer_code = row['Stripe cus_ code'])
if len(m.birth_date) == 0:
m.birth_date = datetime.date.today()
try:
m.save()
except django.core.exceptions.ValidationError:
print('error: skipping', fname, lname)
raise
#attempt to make a membership
try:
#for empty strings on expire date
if not row['Last day of Membership']:
last_day = datetime.date.today()
else:
last_day = datetime.datetime.strptime(row['Last day of Membership'], '%Y-%m-%d').date()
if last_day > datetime.date.today():