コード例 #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
ファイル: controllers.py プロジェクト: victorlcampos/AlgPedia
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
ファイル: controllers.py プロジェクト: victorlcampos/AlgPedia
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