On Mon, Apr 8, 2013 at 7:26 PM, Giorgos Kontogiorgakis
<[email protected]> wrote:
> Hi there guys!I have an answer about renaming objects on my webinterface.For
> example i have a table named "Map" and i have many obejcts in there(Map
> object,Map object,Map object,Map object,Map object,Map object) How is it
> possible to rename them?I mean i want to have something like (Map Asia,Map
> Europe,Map America,Map Africa and so on) for every object to give him a
> different name.
>
Hi Giorgos;
I assume you mean django admin by webinterface. If I understood you
right; In your models, if you define a __unicode__ function, you can
get what you want. Just a plain example:
Class Map(models.Model):
name = models.CharField(max_length=64)
..
..
def __unicode__(self):
return self.name
Assuming you create maps like this:
asia=Map(name="Map Asia")
asia.save()
For more details, take a look at
https://docs.djangoproject.com/en/dev/ref/models/instances/#unicode
--
- Serdar Dalgıç <[email protected]>
FLOSS Developer, Life & Nature Hacker
twitter: https://twitter.com/serdaroncode
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.