-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Not Getting It Right #11
Comments
Hi You shouldn't include the form but use the template tags provided: {% load follow_tags %}
{% follow_form request.user.profile %} That should make it work. |
(Obviously you'd have to adjust the |
I’m still not getting it bro! I’m getting this error:
This is what I did. In Models: class UserProfile(models.Model):
user=models.ForeignKey(User, unique=True)
avatar=models.ImageField("Profile Pic", upload_to="photologue/photos/", blank=True, null=True)
names=models.CharField(max_length=50)
country=models.CharField(max_length=50)
state_province=models.CharField(max_length=50)
url=models.URLField('Website', blank=True)
bio=models.TextField(max_length=1000)
objects=ProfileManager()
def __unicode__(self):
return u"%s" % self.user
def get_absolute_url(self):
return ('profiles_profile_detail',(),{'username':self.username})
utils.register(UserProfile) In follow/form.html {% load follow_tags %}
<form action="{% follow_url UserProfile %}" method="POST">
{% csrf_token %}
{% if request.user|is_following:UserProfile %}
<input type="submit" value="Unfollow" />
{% else %}
<input type="submit" value="Follow" />
{% endif %}
</form> In profiles/profile_detail.html {% load follow_tags %}
{% follow_form request.user.UserProfile %} What am I doing wrong? |
The FixTry setting the {% load follow tags %}
{% follow_form request.user.get_profile %} |
Also, don't modify the |
(You seem to be assuming that the |
Hello, I’m not getting the usage of the package in template, because I keep getting error. What I did is this; I want to use it for following of users. Just like how friends add each other up or follow each other on sites like twitter.
So I registered it with UserProfile in models,py.
utils.register(UserProfile)
And UserProfile consists of fields like names, state, country, etc.
After registering it in models, I went on to profiles template and ‘include /follow/form.html’ so that if a user finds another users profile, and both are not following each other, it will be easy for one of them to make the request by following. But I keep getting error.
My question now is this: How will I make use of it in the template? What is the best way of doing this? Hope to hear from you soon. Thanks!
The text was updated successfully, but these errors were encountered: