It looks like you have an indentation error. your __unicode__ method is should be a method in the Customer class, so it should be indented inside it. Right now it is outside the class namespace
On Tuesday, May 6, 2014 11:44:46 AM UTC-5, G Z wrote: > > so in my models .py file I have > > > from django.db import models > > # Create your models here. > > class Customer(models.Model): > NAME = models.CharField(max_length=200) > WEBSITE = models.CharField(max_length=200) > PHONE = models.CharField(max_length=200) > EMAIL = models.CharField(max_length=200) > ADDRESS = models.CharField(max_length=200) > VMIDS = models.CharField(max_length=200) > > def __unicode__(self): > return self.NAME > # return self.NAME > > class Vms(models.Model): > VMID = models.CharField(max_length=200) > VMNAME = models.CharField(max_length=200) > VMSTATUS = models.CharField(max_length=200) > CUSTOMERID = models.ForeignKey(Customer) > > class Vmspecs(models.Model): > CPUS = models.CharField(max_length=200) > CORES = models.CharField(max_length=200) > MEMORY = models.CharField(max_length=200) > HDSPACE = models.CharField(max_length=200) > OS = models.CharField(max_length=200) > UPTIME = models.CharField(max_length=200) > VMID = models.ForeignKey(Vms) > > On my admin stite it doesnt return self.NAME as the customer name it just > returns the word customer object for entries and im not sure why. > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0965db5a-e0ea-480b-af19-740452bdd4c6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

