Recommend a way to add my own class into DjanGo

12 views
Skip to first unread message

Django Newbie

unread,
Oct 17, 2012, 8:16:07 AM10/17/12
to django...@googlegroups.com
Hey guys,

I want to create a custom class with methods I will be able to access everywhere in my Views.

For example a class that add numbers after declaring it somewhere in Django. 
MyNumber = new GenNumberClass()
MyNumber.setNumbers(1,2)
result = MyNumber.getAddedResult()

Please point me in the right direction where I can declare classes and reuse them. Any recommendations will be welcome.

Thanks.

Bill Freeman

unread,
Oct 17, 2012, 8:19:26 AM10/17/12
to django...@googlegroups.com
This is a python question, not specifically a Django question. I
suggest that you
work through the following tutorial:

http://docs.python.org/tutorial/index.html
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/dHGOSKJe-GcJ.
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
Reply all
Reply to author
Forward
0 new messages