On Tuesday, November 11, 2014 1:26:53 PM UTC-8, krmane wrote:
>
>
> 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.d...@gmail.com 
> <javascript:>> 
> > 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...@googlegroups.com <javascript:>. 
> >> To post to this group, send email to django...@googlegroups.com 
> <javascript:>. 
> >> 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. 
> >> 
>
>
It's better to start another thread rather than hijacking a thread. 
Otherwise, people who have the same question as you can't tell by looking 
at the title of this post. But to answer your question, the comments at the 
start of the tutorial read as follows:

*If you are still using Python 2.7, you will need to adjust the code 
samples slightly, as described in comments.*

 

-- 
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/99931953-6f0e-4bc2-a82b-499e580d9831%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to