Hi,
I am newbie at Django.I have model with a custom method.In view I am
retrieving a single object.See below --
My model
class Problem(models.Model):
    problem = models.CharField(max_length=100)
    solution=models.CharField(max_length=500)
    def __unicode__(self):
        return self.problem
   def retrieve_rankdata(self):
                return self.problem.split()[0].split('/')

in view
I am doing this
def show(request):
       problem = Problem.objects.all()[0]
        t1=problem.retrieve_rankdata()
But, I am getting this error
'Problem' object has no attribute 'retrieve_rankdata'

What am I doing wrong?
thanks


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to