That brings me to another related question.
I had asked this before but let's put it in a different way.
With the official Django tutorial for 1.7, they say it is ment for Python 3X. Do we have any plan to have some appendix on using the same tutorial for Python 2.7x?
Like to have this code working with 2.7 do XYZ instead of ABC.
Happy hacking.
Krishnakant.On 11/12/2014 01:56 AM, Jorge Andrés Vergara Ebratt wrote:
When you are in Python3 you don't use __unicode__ you use __str__

On Tue, Nov 11, 2014, 3:14 PM Arjan de Knegt <arjan.de.kn...@gmail.com>
wrote:

I am using Django 1.7.1 with python 3.4.0 for my latest project.
I am working on a model called Song. In the admin site all object that I
add show as "Song object" where I would expect the title of the Song. I
have added __unicode__ to the model. is there something I miss or are
things changed in Django 1.7? Below the model and what is shown in the
admin site

*Model:*
class Song(models.Model):
     title = models.CharField(max_length=100, verbose_name = 'Titel')
     author = models.CharField(max_length=100, verbose_name = 'Auteur')
     genre = models.ForeignKey('Genre', to_field='genre')
     featured = models.BooleanField(default = False, verbose_name =
'featured')
     song_order = models.IntegerField()

     class Meta:
         verbose_name = _('Song')
         verbose_name_plural = _('Songs')
         ordering = ['song_order']

     def __unicode__(self):
         return self.title

*Shown in Admin site:*
  Song
   Song object <http://localhost:8000/admin/playlist/song/1/> Song object
<http://localhost:8000/admin/playlist/song/2/> Song object
<http://localhost:8000/admin/playlist/song/3/> Song object
<http://localhost:8000/admin/playlist/song/4/>

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/01cc75ba-302c-4066-9e4a-fbdc4f3504ea%40googlegroups.com
<https://groups.google.com/d/msgid/django-users/01cc75ba-302c-4066-9e4a-fbdc4f3504ea%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.


--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/546277F5.9080503%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to