Get an instance of the model and call getValue() on it.

i.e.

my_model_instance = myClass.objects.get(pk=12)
my_model_instance.getValue()

-joe

On 10/4/07, Goon <[EMAIL PROTECTED]> wrote:
>
> probably a dumb question, what's the syntax for calling a method in
> models.py from views.py?
>
> so like:
>
> #models.py
> class myClass (models.Model):
>   value = 24
>   def getValue(self):
>        return value
>
>
> #views.py
> def myFunction():
>       myData = ###what do I put here to call "getValue()" instead of
> looking up the value field itself?
>
>
> thanks
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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