Beispiel #1
0
	def add(self,first,last,email,password,picture=None):
		'''
		Add User
		'''
		user=tutor_model().set_or_get(email)
		if user.email:
			return False
		else:
			user.first=first
			user.last=last
			user.email=email
			user.password=password
			user.activate = True
			user.subjects.append(subject_model().find_name('Programacion Orientada a Objetos').key())
			#if not picture:
			#    user.picture=db.Blob('Static\img\visitor.png')
			#else:   
			#    user.picture = picture
			user.put()                    
			return True
Beispiel #2
0
    def add(self, first, last, email, password, picture=None):
        '''
		Add User
		'''
        user = tutor_model().set_or_get(email)
        if user.email:
            return False
        else:
            user.first = first
            user.last = last
            user.email = email
            user.password = password
            user.activate = True
            user.subjects.append(subject_model().find_name(
                'Programacion Orientada a Objetos').key())
            #if not picture:
            #    user.picture=db.Blob('Static\img\visitor.png')
            #else:
            #    user.picture = picture
            user.put()
            return True
Beispiel #3
0
	def find_name(self,name):
		return subject_model().find_name(name)
Beispiel #4
0
	def get_subject_by_name(self,name):
		return subject_model().find_name(name)
Beispiel #5
0
	def get_all_subjects(self):				
		return subject_model().get_all_subject()
Beispiel #6
0
	def get_subject(self,subject_id):
		return subject_model().get_subject(subject_id)
Beispiel #7
0
	def modify(self,subject_key,subject_name):
		
		subject_instance = subject_model().get_subject(subject_key.id())
		subject_instance.name = subject_name
		subject_instance.put()
		return True
Beispiel #8
0
	def add(self,subject_name):
		subject_instance = subject_model()
		subject_instance.name = subject_name
		subject_instance.put()
		return True
Beispiel #9
0
 def find_name(self, name):
     return subject_model().find_name(name)
Beispiel #10
0
 def get_subject_by_name(self, name):
     return subject_model().find_name(name)
Beispiel #11
0
 def get_all_subjects(self):
     return subject_model().get_all_subject()
Beispiel #12
0
 def get_subject(self, subject_id):
     return subject_model().get_subject(subject_id)
Beispiel #13
0
    def modify(self, subject_key, subject_name):

        subject_instance = subject_model().get_subject(subject_key.id())
        subject_instance.name = subject_name
        subject_instance.put()
        return True
Beispiel #14
0
 def add(self, subject_name):
     subject_instance = subject_model()
     subject_instance.name = subject_name
     subject_instance.put()
     return True