# Path: docs/example/models.py
# class Person(Model):
#     first_name = field.String("Name", index=True)
#     last_name = field.String("Surname", index=True)
#     work = Unit(verbose_name="Work", reverse_name="workers")
#     home = Unit(verbose_name="Home", reverse_name="residents")
# 
# 
#     class ContactInfo(Node):
#         address = field.String("Address", index=True, null=True, blank=True)
#         city = field.String("City", index=True)
#         phone = field.String("Phone", index=True)
#         email = field.String("Email", index=True)
# 
#     class Permissions(ListNode):
#         perm = Permission()
# 
#         def __unicode__(self):
#             return self.perm
# 
#     def __unicode__(self):
#         return "%s %s" % (self.first_name, self.last_name)
# 
#     def get_permission_codes(self):
#         return [p.perm.code for p in self.Permissions]
# 
#     def add_permission(self, perm):
#         self.Permissions(permission=perm)
#         self.save()
# 
#     def has_permission(self, perm):
#         return perm in self.Permissions
# 
#     def has_permission_code(self, perm_code):
#         perm = Permission.object.get(code=perm_code)
#         return self.has_permission(perm)
# 
# class Unit(Model):
#     name = field.String("Name", index=True)
#     address = field.String("Address", index=True, null=True, blank=True)
# 
#     class Meta:
#         verbose_name = "Unit"
#         verbose_name_plural = "Units"
# 
#     def __unicode__(self):
#         return self.name


from .models import Person, Unit
# -*-  coding: utf-8 -*-
"""
"""

# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3).  See LICENSE.txt for details.


user = Person(first_name='Bugs')
user.last_name = 'Bunny'
contact_info = user.ContactInfo(email="foo@foo.com", city="Izmir")
contact_info.phone = "902327055555"
user.work = Unit(name="Acme").save()

# Path: docs/example/models.py
# class Person(Model):
#     first_name = field.String("Name", index=True)
#     last_name = field.String("Surname", index=True)
#     work = Unit(verbose_name="Work", reverse_name="workers")
#     home = Unit(verbose_name="Home", reverse_name="residents")
# 
# 
#     class ContactInfo(Node):
#         address = field.String("Address", index=True, null=True, blank=True)
#         city = field.String("City", index=True)
#         phone = field.String("Phone", index=True)
#         email = field.String("Email", index=True)
# 
#     class Permissions(ListNode):
#         perm = Permission()
# 
#         def __unicode__(self):
#             return self.perm
# 
#     def __unicode__(self):
#         return "%s %s" % (self.first_name, self.last_name)
# 
#     def get_permission_codes(self):
#         return [p.perm.code for p in self.Permissions]
# 
#     def add_permission(self, perm):
#         self.Permissions(permission=perm)
#         self.save()
# 
#     def has_permission(self, perm):
#         return perm in self.Permissions
# 
#     def has_permission_code(self, perm_code):
#         perm = Permission.object.get(code=perm_code)
#         return self.has_permission(perm)
# 
# class Unit(Model):
#     name = field.String("Name", index=True)
#     address = field.String("Address", index=True, null=True, blank=True)
# 
#     class Meta:
#         verbose_name = "Unit"
#         verbose_name_plural = "Units"
# 
#     def __unicode__(self):
#         return self.name


# Path: docs/example/views.py
from .models import Person, Unit

# -*-  coding: utf-8 -*-
"""
"""

# Copyright (C) 2015 ZetaOps Inc.
#
# This file is licensed under the GNU General Public License v3
# (GPLv3).  See LICENSE.txt for details.


user = Person(first_name='Bugs')
user.last_name = 'Bunny'
contact_info = user.ContactInfo(email="foo@foo.com", city="Izmir")
contact_info.phone = "902327055555"
user.work = Unit(name="Acme").save()

user.home = Unit(name="Emac").save()