app/soc/models/seed_db.py
changeset 1907 8e1ea5609325
parent 1906 224f597846b5
child 1929 1ce28a2dd71f
equal deleted inserted replaced
1906:224f597846b5 1907:8e1ea5609325
   375       }
   375       }
   376 
   376 
   377   return properties
   377   return properties
   378 
   378 
   379 
   379 
       
   380 def seed_org_app(request, i):
       
   381   """Returns the properties for a new org proposal,
       
   382   """
       
   383 
       
   384   account, current_user = ensureUser()
       
   385   status = request.GET.get('status', 'pre-accepted')
       
   386   gsoc2009 = Program.get_by_key_name('google/gsoc2009')
       
   387 
       
   388   if not gsoc2009:
       
   389     raise Error('Run seed_db first')
       
   390 
       
   391   properties = {
       
   392       'key_name': 'google/gsoc2009/org_app_%d' % i,
       
   393       'link_id': 'org_app_%d' % i,
       
   394       'name': 'Org App %d' % i,
       
   395       'scope_path': 'google/gsoc2009',
       
   396       'scope': gsoc2009,
       
   397       'status': status,
       
   398       'applicant': current_user,
       
   399       'home_page': 'http://www.google.com',
       
   400       'email': 'org@example.com',
       
   401       'irc_channel': '#care',
       
   402       'pub_mailing_list': 'http://groups.google.com',
       
   403       'dev_mailing_list': 'http://groups.google.com',
       
   404       'description': 'This is an awesome org!',
       
   405       'why_applying': 'Because we can',
       
   406       'member_criteria': 'They need to be awesome',
       
   407       'license_name': 'Apache License, 2.0',
       
   408       'ideas': 'http://code.google.com/p/soc/issues',
       
   409       'contrib_disappears': 'We use google to find them',
       
   410       'member_disappears': 'See above',
       
   411       'encourage_contribs': 'We offer them cookies.',
       
   412       'continued_contribs': 'We promise them a cake.',
       
   413       'agreed_to_admin_agreement': True,
       
   414       }
       
   415 
       
   416   return properties
       
   417 
       
   418 
   380 def seed_org(request, i):
   419 def seed_org(request, i):
   381   """Returns the properties for a new org entity.
   420   """Returns the properties for a new org entity.
   382   """
   421   """
   383 
   422 
   384   account, current_user = ensureUser()
   423   account, current_user = ensureUser()
   492     return http.HttpResponse('Missing get args.')
   531     return http.HttpResponse('Missing get args.')
   493 
   532 
   494   seed_types = {
   533   seed_types = {
   495     'user': (seed_user, User),
   534     'user': (seed_user, User),
   496     'org': (seed_org, Organization),
   535     'org': (seed_org, Organization),
       
   536     'org_app': (seed_org_app, OrgApplication),
   497     'mentor': (seed_mentor, Mentor),
   537     'mentor': (seed_mentor, Mentor),
   498     'student_proposal': (seed_student_proposal, StudentProposal),
   538     'student_proposal': (seed_student_proposal, StudentProposal),
   499     }
   539     }
   500 
   540 
   501   goal = int(get_args['goal'])
   541   goal = int(get_args['goal'])