how do I fix this?

class Vm_licenses(models.Model):
   vm_license_id = models.BigIntegerField(primary_key = True, editable = 
False, db_column = 'vm_license_id')
   license= models.ForeignKey(License,  on_delete = models.PROTECT)
   vm= models.ForeignKey(Vm,  on_delete = models.PROTECT)

   class Meta:
      managed = False
      db_table = 'vm_licenses'
   
   def __unicode__(self):  # Python 3: def __str__(self):
      return self.vm_id

Request Method:GETRequest URL:
http://127.0.0.1:8000/admin/portal/vm_licenses/Django Version:1.6.5Exception 
Type:AttributeErrorException Value:

'int' object has no attribute 'encode'

Exception 
Location:/usr/local/lib/python2.7/dist-packages/django/db/models/base.py 
in __str__, line 430Python Executable:/usr/bin/pythonPython Version:2.7.5

-- 
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/06de81a6-131a-4e6e-9f24-c370cdd14076%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to