Hi,

first of all use if request.POST, second pehaps you should pass the pk as
part of the action URL.
Do you get any errors or anything?


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Mon, Mar 5, 2012 at 4:54 PM, leaks <tonykyriaki...@gmail.com> wrote:

> I don't get an error... Nothing just happens
>
> my view: (I think the problem is here)
>
> def push(request, pk):
>     if request.method == 'POST':
>         entry = Entry.objects.get(pk=pk)
>         entry.pushes +=1
>         entry.save()
>
> My template:
>
> <ul>
> {% for entry in entries.object_list %}
> <li><a href="{{ entry.link }}" >{{ entry.title }}</a>
> Posted on {{ entry.posted }} by {{ entry.submitter }} | pushed {{
> entry.pushes }} time(s).
> {% if user.is_authenticated %}
> #or maybe here...
> <form action="." method="POST">
> {% csrf_token %}
> <input type="submit" value="Push">
> </form>
> </li>
> {% endfor %}
> </ul>
>
> This is my first project and i haven't really understood how GET and POST
> request's work with models...
>
> Thanks in advance :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/8GXXgG28NcQJ.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to