예제 #1
0
def add_user_point(u_username):
    u_user = User.objects.get(username=u_username)
    try:
        ur = UserReputation.objects.get(user=u_user)
        ur.reputation = ur.reputation + 1
        ur.save()
    except UserReputation.DoesNotExist:
        ur = UserReputation(user=u_user, reputation=1)
        ur.save()
예제 #2
0
def add_user_point(u_username):
	u_user = User.objects.get(username=u_username)
	try:
		ur = UserReputation.objects.get(user=u_user)
		ur.reputation = ur.reputation + 1
		ur.save()
	except UserReputation.DoesNotExist:
		ur = UserReputation(user=u_user, reputation=1)
		ur.save()
예제 #3
0
def save_university(u_username, u_university):
    u_user = User.objects.get(username=u_username)
    try:
        ur = UserReputation.objects.get(user=u_user)
        ur.university = u_university
        ur.save()
    except UserReputation.DoesNotExist:
        ur = UserReputation(user=u_user, reputation=1, university=u_university)
        ur.save()
예제 #4
0
def save_university(u_username, u_university):
	u_user = User.objects.get(username=u_username)
	try:
		ur = UserReputation.objects.get(user=u_user)
		ur.university = u_university
		ur.save()
	except UserReputation.DoesNotExist:
		ur = UserReputation(user=u_user, reputation=1, university=u_university)
		ur.save()
예제 #5
0
def insert_user_reputation(u_username, u_reputation):
    u_user = User.objects.get(username=u_username)
    ur = UserReputation(user=u_user, reputation=u_reputation)
    ur.save