Not sure I understood the problem. Are you trying to print only the data in
the "importance" field?
If so, try:

class Crop(models.Model):
    name = models.CharField(max_length=30)
    importance = models.TextField()
    cultivation = models.TextField()
    def __unicode__(self):
        return u'%s' % (self.importance,)

​

On Thu, Apr 2, 2015 at 10:01 AM, temiloluwa adesina <
adesinatemilol...@gmail.com> wrote:

> Hello
> I just joined this group and i have problems with representing multiple
> fields in admin using __unicode__, when i try to call this data it returns
> just one of them:
>
> class Crop(models.Model):
>     name = models.CharField(max_length=30)
>     importance = models.TextField()
>     cultivation = models.TextField()
>     def __unicode__(self):
>         return u'%s %s %s' % (self.name, self.importance, self.cultivation
> )
>
>
> <https://lh3.googleusercontent.com/-2cHWwMHqUnY/VR09L1-ntvI/AAAAAAAAAGY/AdVaYuoL6As/s1600/Screenshot%2B%2840%29.png>
> but rather than returning just the data in the importance field, it
> returns all the data in each separate field together.
>
> Pls i would appreciate anyone's assistance.
>
> --
> 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/504bf928-7259-4d17-994c-115e98a78a4b%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/504bf928-7259-4d17-994c-115e98a78a4b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 


*Filipe Ximenes*+55 (81) 8245-9204

*Vinta Software Studio*http://www.vinta.com.br

-- 
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/CAA-QWB2h4TtWBoyf1yAzBppUj-jNAs3B%2BF%2BiZB3DX8twcjbR0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to