Hi, Avraham,
Well, I'm looking for a way to "properly" override this function.
The problem is that I have a lot more text fields in a table/model than 
just 2, but they are not related as in my example first and last name.

So what would be the proper implementation?

Because right now following tutorial, I don't see a database text when 
displaying the records.

Thank you.


On Wednesday, January 8, 2014 3:03:58 PM UTC-8, Igor Korot wrote:
>
> Hi, ALL,
> In the tutorial it is said that I need to create __unicode__() function to 
> properly display the results of my model.
> Unfortunately the tutorial is using only one text field and everywhere I 
> looked people are using something related, i.e. first_name+last_name and so 
> they can create a tuple.
>
> What if my strings are not related to each other at all?
> For example I might have:
>
> from django.db import models
>
> class Stuff(models.Model):
>      Manufacturer = models.CharField(max_length=100)
>      Serial_number = models.CharField(max_length=20)
>
> manufacturer and serial_number are not related and I don't want them to be 
> displayed as one field in the output.
> So what the __unicode__() function will look like in this case?
>
> Thank you.
>

-- 
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/fd76cc47-1560-4be1-a040-af0af17b60d1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to