jquery - Need help making Django + Ajax like button -
i new coding , have implemented button online book - tango django: http://www.tangowithdjango.com/book17/chapters/ajax.html#add-a-like-button however project need record users have liked , ensure can item once (similar instagram/facebook). have looked @ other related questions online have found there no laid out answer other beginners follow. if easy follow answer me , other people trying achieve same in future, appreciated! my current code follows: models class userproject(models.model): user = models.foreignkey(user) title = models.charfield(max_length=100) date_created = models.datetimefield(auto_now_add=true) project_likes = models.integerfield(default=0) slug = models.slugfield(max_length=100, unique=true) views @login_required def like_project(request): proj_id = none if request.method == 'get': proj_id = request.get['project_id'] likes = 0 if proj_id: proj = userproject.objects.get(id=int(p...