# Path: cyder/base/mixins.py
# class ObjectUrlMixin(object):
#     """
#     This is a mixin that adds important url methods to a model. This
#     class uses the ``_meta.db_table`` instance variable of an object to
#     calculate URLs. Because of this, you must use the app label of your
#     class when declaring urls in your urls.py.
#     """
#     @classmethod
#     def get_list_url(cls):
#         """
#         Return the 'list' url of an object. Class method since don't
#         need specific instance of object.
#         """
#         return reverse(cls._meta.db_table)
# 
#     @classmethod
#     def get_create_url(cls):
#         """Return the create url of the type of object (to be posted to)."""
#         return cls.get_list_url()
# 
#     def get_update_url(self):
#         """Return the update url of an object."""
#         return reverse(self._meta.db_table + '-update', args=[self.pk])
# 
#     def get_delete_url(self):
#         """Return the delete url of an object."""
#         return reverse('delete')
# 
#     def get_detail_url(self):
#         """Return the detail url of an object."""
#         try:
#             return reverse(self._meta.db_table + '-detail', args=[self.pk])
#         except NoReverseMatch:
#             return ''
# 
#     def get_table_update_url(self):
#         """Return the editableGrid update url of an object."""
#         try:
#             return reverse(self._meta.db_table + '-table-update',
#                            args=[self.pk])
#         except NoReverseMatch:
#             return ''
# 
#     def details(self):
#         """
#         Return base details with generic postback URL for editable tables.
#         """
#         return {'url': self.get_table_update_url()}


from itertools import chain
from django.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_OPTION, ATTRIBUTE_STATEMENT
from cyder.base.eav.fields import EAVAttributeField
from cyder.base.eav.models import Attribute, EAVBase
from cyder.base.mixins import ObjectUrlMixin
from cyder.base.models import BaseModel
from cyder.base.utils import transaction_atomic
from cyder.cydhcp.utils import join_dhcp_args
        from cyder.cydhcp.interface.static_intr.models import StaticInterface
        from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface




class Workgroup(BaseModel, ObjectUrlMixin):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=100, unique=True)

    search_fields = ('name',)
    sort_fields = ('name',)

    class Meta:
        app_label = 'cyder'

# Path: cyder/base/mixins.py
# class ObjectUrlMixin(object):
#     """
#     This is a mixin that adds important url methods to a model. This
#     class uses the ``_meta.db_table`` instance variable of an object to
#     calculate URLs. Because of this, you must use the app label of your
#     class when declaring urls in your urls.py.
#     """
#     @classmethod
#     def get_list_url(cls):
#         """
#         Return the 'list' url of an object. Class method since don't
#         need specific instance of object.
#         """
#         return reverse(cls._meta.db_table)
# 
#     @classmethod
#     def get_create_url(cls):
#         """Return the create url of the type of object (to be posted to)."""
#         return cls.get_list_url()
# 
#     def get_update_url(self):
#         """Return the update url of an object."""
#         return reverse(self._meta.db_table + '-update', args=[self.pk])
# 
#     def get_delete_url(self):
#         """Return the delete url of an object."""
#         return reverse('delete')
# 
#     def get_detail_url(self):
#         """Return the detail url of an object."""
#         try:
#             return reverse(self._meta.db_table + '-detail', args=[self.pk])
#         except NoReverseMatch:
#             return ''
# 
#     def get_table_update_url(self):
#         """Return the editableGrid update url of an object."""
#         try:
#             return reverse(self._meta.db_table + '-table-update',
#                            args=[self.pk])
#         except NoReverseMatch:
#             return ''
# 
#     def details(self):
#         """
#         Return base details with generic postback URL for editable tables.
#         """
#         return {'url': self.get_table_update_url()}


# Path: cyder/cydhcp/workgroup/models.py
from itertools import chain
from django.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError
from cyder.base.eav.constants import ATTRIBUTE_OPTION, ATTRIBUTE_STATEMENT
from cyder.base.eav.fields import EAVAttributeField
from cyder.base.eav.models import Attribute, EAVBase
from cyder.base.mixins import ObjectUrlMixin
from cyder.base.models import BaseModel
from cyder.base.utils import transaction_atomic
from cyder.cydhcp.utils import join_dhcp_args
        from cyder.cydhcp.interface.static_intr.models import StaticInterface
        from cyder.cydhcp.interface.dynamic_intr.models import DynamicInterface





class Workgroup(BaseModel, ObjectUrlMixin):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=100, unique=True)

    search_fields = ('name',)
    sort_fields = ('name',)

    class Meta:
        app_label = 'cyder'

        db_table = 'workgroup'