I have a model with data in it defined like this:
class SyncJob(models.Model):
date = models.DateTimeField()
user = models.ForeignKey(User, unique=False)
source = models.CharField(max_length=3, choices=FS_CHOICES)
destination = models.CharField(max_length=3, choices=FS_CHOICES)
options = models.CharField(max_length=10, choices=OPTIONS)
def _unicode_(self):
return u'%s %s %s' % (self.date, self.source, self.destination)
And I have a view to retrieve data:
def retrieve(request):
sync = SyncJob.objects.get(id=02)
return render_to_response('base.html', {'sync': sync})
But when rendering the page I only get: SyncJob object Instead of getting the date, source and destination info. How can I make it so I get this data?