Question: Why is a unicode function required in models.py?

i.e,

```
def __unicode__(self)
    return sumid;

```

Answer: 
It's not. If you define a `__unicode__()` method, Django will call it when it needs to render an object in a context where a string representation is needed (e.g. in the model's admin pages).

The [documentation](http://docs.djangoproject.com/en/dev/ref/models/instances/#unicode) says:

> 
> The `__unicode__()` method is called
>  whenever you call `unicode()` on an
>  object. Since Django's database
>  backends will return Unicode strings
>  in your model's attributes, you would
>  normally want to write a `__unicode__()`
>  method for your model.
> 
> 
>
I think the others have given some detailed explanations that should be more than enough for you. But here's a straightforward answer: `__unicode__()` is equivalent to `toString()` in Java (and many other languages)