Thursday, April 20, 2017

How can i add one point to user after to press the button?

I have Model.
class UserProfile(models.Model):
    user = models.OneToOneField(User, related_name='userprofile')
    points = models.IntegerField(default=0)
    city = models.CharField(max_length=30, blank=True)
    about = models.TextField(blank=True)
    avatar = models.ImageField(upload_to='avatars/', verbose_name='Изображения', blank=True)

For example, if the user(authenticated) presses the button in an HTML file he wiil add one point.
How can I do it?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/97ba4189-7d02-4d8d-9be9-7e93ea52a2fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment