Project

General

Profile

« Previous | Next » 

Revision 01b413fe

Added by Benjamin Dauvergne over 12 years ago

ressources: do not put the ressource id in its unicode() value

  • adapt the list.html template to output the id explicitely now.

View differences:

calebasse/ressources/models.py
15 15
    name = models.CharField(max_length=80, verbose_name=u'Nom')
16 16

  
17 17
    def __unicode__(self):
18
        return self.name + ' (%s)' % self.id
18
        return self.name
19 19

  
20 20
    def __repr__(self):
21 21
        return '<%s %r>' % (self.__class__.__name__, unicode(self))
calebasse/ressources/templates/ressources/list.html
15 15
    <ul id="ressource-list">
16 16
     {% for object in object_list %}
17 17
     <li id="ressource-{{ object.pk }}">
18
       <a href="{{ object.pk }}">{{object}}</a> 
18
     <a href="{{ object.pk }}">{{object}} ({{object.pk}})</a> 
19 19
       <button class="dialog-button delete-object-button" 
20 20
               data-url="{{ object.pk }}/delete/ #form-content">Supprimer</button>
21 21
     </li>

Also available in: Unified diff