本文整理汇总了Python中soc.modules.gsoc.models.proposal.GSoCProposal.key方法的典型用法代码示例。如果您正苦于以下问题:Python GSoCProposal.key方法的具体用法?Python GSoCProposal.key怎么用?Python GSoCProposal.key使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soc.modules.gsoc.models.proposal.GSoCProposal
的用法示例。
在下文中一共展示了GSoCProposal.key方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: seed
# 需要导入模块: from soc.modules.gsoc.models.proposal import GSoCProposal [as 别名]
# 或者: from soc.modules.gsoc.models.proposal.GSoCProposal import key [as 别名]
def seed(request, *args, **kwargs):
"""Seeds the datastore with some default values.
"""
site_properties = {
'key_name': 'site',
'latest_gsoc': 'google/gsoc2014',
'latest_gci': 'google/gci2013',
}
site = Site(**site_properties)
site.put()
account = accounts.getCurrentAccount()
if not account:
account = users.User(email='[email protected]')
user_properties = {
'id': 'test',
'account_id': account.user_id(),
'account': account,
}
current_user = user.User(**user_properties)
current_user.put()
group_properties = {
'key_name': 'google',
'link_id': 'google',
'name': 'Google Inc.',
'short_name': 'Google',
'home_page': 'http://www.google.com',
'email': '[email protected]',
'description': 'This is the profile for Google.',
'contact_street': 'Some Street',
'contact_city': 'Some City',
'contact_country': 'United States',
'contact_postalcode': '12345',
'phone': '15551110000',
'status': 'active',
}
google = Sponsor(**group_properties)
google.put()
now = datetime.datetime.now()
before = now - datetime.timedelta(365)
after = now + datetime.timedelta(365)
past_before = before - datetime.timedelta(2 * 365)
past_after = after - datetime.timedelta(2 * 365)
timeline_properties = {
'key_name': 'google/gsoc2014',
'link_id': 'gsoc2014',
'scope': google,
'program_start': before,
'program_end': after,
'accepted_organization_announced_deadline': before,
'accepted_students_announced_deadline' : after,
'student_signup_start': before,
'student_signup_end': after,
'application_review_deadline': after,
'student_application_matched_deadline': after,
'accepted_students_announced_deadline': after,
'form_submission_start': before,
}
gsoc2014_timeline = GSoCTimeline(**timeline_properties)
gsoc2014_timeline.put()
program_properties = {
'key_name': 'google/gsoc2014',
'link_id': 'gsoc2014',
'program_id': 'gsoc2014',
'sponsor': google,
'scope': google,
'name': 'Google Summer of Code 2014',
'short_name': 'GSoC 2014',
'description': 'This is the program for GSoC 2014.',
'apps_tasks_limit': 42,
'slots': 42,
'timeline': gsoc2014_timeline,
'status': program_model.STATUS_VISIBLE,
}
gsoc2014 = GSoCProgram(**program_properties)
gsoc2014.put()
timeline_properties.update({
'key_name': 'google/gsoc2010',
'link_id': 'gsoc2010',
'program_start': past_before,
'program_end': past_after,
'accepted_organization_announced_deadline': past_before,
'accepted_students_announced_deadline' : past_after,
'student_signup_start': past_before,
'student_signup_end': past_after,
'application_review_deadline': past_after,
'student_application_matched_deadline': past_after,
'accepted_students_announced_deadline': past_after,
'form_submission_start': past_before,
})
gsoc2010_timeline = GSoCTimeline(**timeline_properties)
gsoc2010_timeline.put()
#.........这里部分代码省略.........
示例2: seed
# 需要导入模块: from soc.modules.gsoc.models.proposal import GSoCProposal [as 别名]
# 或者: from soc.modules.gsoc.models.proposal.GSoCProposal import key [as 别名]
def seed(request, *args, **kwargs):
"""Seeds the datastore with some default values.
"""
site_properties = {
'key_name': 'site',
'latest_gsoc': 'numenta/son2014',
# 'latest_gci': 'numenta/gci2013',
}
site = Site(**site_properties)
site.put()
account = accounts.getCurrentAccount()
if not account:
account = users.User(email='[email protected]')
user_properties = {
'id': 'matt',
'account_id': account.user_id(),
'account': account,
}
current_user = user.User(**user_properties)
current_user.put()
group_properties = {
'key_name': 'numenta',
'link_id': 'numenta',
'name': 'Numenta Inc.',
'short_name': 'Numenta',
'home_page': 'http://numenta.org',
'email': '[email protected]',
'description': 'This is the profile for Numenta.',
'contact_street': '811 Hamilton St',
'contact_city': 'Redwood City, CA',
'contact_country': 'United States',
'contact_postalcode': '94063',
'phone': '6503698282',
'status': 'active',
}
numenta = Sponsor(**group_properties)
numenta.put()
now = datetime.datetime.now()
# before = now - datetime.timedelta(365)
# after = now + datetime.timedelta(365)
# past_before = before - datetime.timedelta(2 * 365)
# past_after = after - datetime.timedelta(2 * 365)
# first_day = datetime.datetime(2014, 5, 1)
# last_day = datetime.datetime(2014, 9, 1)
# signup_deadline = first_day + datetime.timedelta(30)
# signup_start = first_day
# students_announced = signup_deadline + datetime.timedelta(15)
program_start = datetime.datetime(2014, 3, 5)
program_end = datetime.datetime(2014, 9, 1)
timeline_properties = {
'key_name': 'numenta/son2014',
'link_id': 'son2014',
'scope': numenta,
'program_start': program_start,
'program_end': program_end,
'accepted_organization_announced_deadline': datetime.datetime(2014, 3, 1),
'accepted_students_announced_deadline' : datetime.datetime(2014, 4, 15),
'student_signup_start': datetime.datetime(2014, 3, 5),
'student_signup_end': datetime.datetime(2014, 4, 1),
'application_review_deadline': datetime.datetime(2014, 4, 10),
'form_submission_start': datetime.datetime(2014, 3, 5),
'student_application_matched_deadline': datetime.datetime(2014, 4, 12),
'bonding_start': datetime.datetime(2014, 4, 15),
'bonding_end': datetime.datetime(2014, 5, 1),
'coding_start': datetime.datetime(2014, 5, 1),
'coding_end': datetime.datetime(2014, 8, 1),
}
son2014_timeline = GSoCTimeline(**timeline_properties)
son2014_timeline.put()
program_properties = {
'key_name': 'numenta/son2014',
'link_id': 'son2014',
'program_id': 'son2014',
'sponsor': numenta,
'scope': numenta,
'name': 'Numenta Season of NuPIC 2014',
'short_name': 'SoN 2014',
'description': 'This is the program for SoN 2014.',
'apps_tasks_limit': 42,
'slots': 42,
'timeline': son2014_timeline,
'status': program_model.STATUS_VISIBLE,
#.........这里部分代码省略.........