Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ladon.ladonizer.decorator import ladonize
- from ladon.types.ladontype import LadonType
- from ladon.compat import PORTABLE_STRING
- import logging
- logging.basicConfig(filename='/home/webhosting/ws.dev.savvy.cz/www/service/logs/test.log',level=logging.DEBUG)
- class ContactType(LadonType):
- ID = {
- 'type' : int,
- 'nullable' : True,
- 'doc' : "ID of contact type"
- }
- Name = {
- 'type' : PORTABLE_STRING,
- 'nullable' : True,
- 'doc' : "Name of contact type"
- }
- class Contact(LadonType):
- ID = {
- 'type' : int,
- 'nullable' : True,
- 'doc' : "ID of contact type"
- }
- contactType = ContactType
- class TestLadon(object):
- '''
- Test ladon webservice
- '''
- @ladonize(Contact, rtype = PORTABLE_STRING)
- def test(self, contact):
- logging.debug(contact.contactType)
- logging.debug(contact.contactType.ID)
- logging.debug(contact.contactType.Name)
- return "test"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement