Yeah, it's because of |pprint. It is a debug tools. It can help with a few
issue like model not having a __str__ method (not your case). It also show
how many item are in the queryset (one in your case).

Now that you found the error, you can remove it

2016-09-13 10:30 GMT+02:00 Timothy Steele <steeletimothy2...@gmail.com>:

> thanks i have seen it, but i need to only display  *Packt Publishing* but
> it give this *<Bookmark: Packt Publishing>* in addition
>
>
> On Tuesday, September 13, 2016 at 8:33:53 AM UTC+1, Timothy Steele wrote:
>>
>> please i try my best but i can display my models in a templates i have
>> just created.
>>
>> *Please have a look at the codes in the models.py file*
>>
>> from django.db import models
>> from django.contrib.auth.models import User
>> # Create your models here.
>>
>> class Link(models.Model):
>>     url=models.URLField(unique=True)
>>
>>     def __str__(self):
>>         return self.url
>>
>>
>>
>> class Bookmark(models.Model):
>>     title=models.CharField(max_length=200)
>>     user=models.ForeignKey(User)
>>     link=models.ForeignKey(Link)
>>     def __str__(self):
>>         return self.title
>>
>> *Please have a look at the codes in the  templates file call
>> user_page.html*
>>
>> head>
>>     <meta charset="UTF-8">
>>     <title>Django Bookmarks - User:{{ username }}</title>
>> </head>
>> <body>
>>     <h1>Bookmarks for {{ username }}</h1>
>>     {% if bookmarks %}
>>        <ul>
>>           {% for bookmark in bookmaks %}
>>            <li>{{ bookmarks.title}}</li>
>>           {% endfor %}
>>        </ul>
>>     {% else %}
>>             <p>No bookmark found.</p>
>>     {% endif %}
>>
>>
>> </body>
>>
>> This the codes from the views.py file (the object of the user_page)
>>
>>
>> from django.shortcuts import render
>> from django.http import HttpResponse,Http404
>> from django.template import Context
>> from django.template.loader import get_template
>> from django.contrib.auth.models import User
>> from . models import Bookmark,Link
>>
>>
>> def user_page(request, username):
>>
>>    try:
>>         user=User.objects.get(username=username)
>>
>>     except:
>>         raise Http404('Requested user not found.')
>>     bookmarks=user.bookmark_set.all()
>>     template=get_template('user_page.html')
>>     variables=Context({
>>         'username':username,
>>         'bookmarks': bookmarks
>>     })
>>     output=template.render(variables)
>>     return HttpResponse(output)
>>
>> *i try it out but it only give me this*
>>
>>
>> <https://lh3.googleusercontent.com/-OB60iPiyBoU/V9ertDA2BgI/AAAAAAAAAEo/Sr5kuhswLbcXgfHoWWz6GHyAivtbVZO6ACLcB/s1600/gg.png>
>>
>> --
> 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+unsubscr...@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/c61e7466-fa57-4f0b-b0d8-4992afef5cc6%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c61e7466-fa57-4f0b-b0d8-4992afef5cc6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Cordialement, Coues Ludovic
+336 148 743 42

-- 
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+unsubscr...@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/CAEuG%2BTaF%3DbcGD%2BcLpq29_FG-SNDgSTZKwNycAkzudn8OKUQU8g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to