# Path: hyperadmin/endpoints.py
# class VirtualEndpoint(BaseEndpoint):
#     '''
#     A type of endpoint that does not define any active endpoints itself
#     but references other endpoints.
#     '''
#     name_suffix = 'virtual'
# 
#     def get_children_endpoints(self):
#         return []
# 
#     def get_urls(self):
#         urlpatterns = self.get_extra_urls()
#         urls = [endpoint.get_url_object() for endpoint in self.get_children_endpoints()]
#         urlpatterns += patterns('', *urls)
#         return urlpatterns
# 
#     def get_extra_urls(self):
#         return patterns('',)
# 
#     def urls(self):
#         return self.get_urls(), self.app_name, None
#     urls = property(urls)
# 
#     def dynamic_urls(self):
#         return self, self.app_name, None
# 
#     @property
#     def urlpatterns(self):
#         return self.get_urls()
# 
#     def get_url_object(self):
#         return url(self.get_url_suffix(), include(self.urls))
# 
#     def create_link_prototypes(self):
#         '''
#         Inludes the link prototypes created by the children endpoints
#         '''
#         link_prototypes = super(VirtualEndpoint, self).create_link_prototypes()
# 
#         for endpoint in self.get_children_endpoints():
#             link_prototypes.update(endpoint.link_prototypes)
# 
#         return link_prototypes
# 
#     def get_index_endpoint(self):
#         raise NotImplementedError
# 
#     def get_main_link_name(self):
#         return self.get_index_endpoint().get_main_link_name()
# 
#     def get_url(self, **kwargs):
#         return self.get_index_endpoint().get_url(**kwargs)
# 
#     def generate_api_response(self, api_request):
#         """
#         Calls the index endpoint and returns it's api response
#         :rtype: Link or HttpResponse
#         """
#         endpoint = self.get_index_endpoint().fork(api_request=api_request)
#         return endpoint.generate_api_response(api_request)
# 
# class GlobalSiteMixin(object):
#     '''
#     Endpoints inheriting this class will default to the global site if
#     no site is passed in.
#     '''
#     global_endpoint = False
# 
#     def __init__(self, **kwargs):
#         if 'site' not in kwargs:
#             from hyperadmin.sites import global_site
#             kwargs.setdefault('site', global_site)
#             self.global_endpoint = True
#         super(GlobalSiteMixin, self).__init__(**kwargs)
# 
#     def urls(self):
#         if self.global_endpoint:
#             return self.get_urls(), self.app_name, self.site.namespace
#         return self.get_urls(), self.app_name, None
#     urls = property(urls)
# 
# Path: hyperadmin/resources/hyperobjects.py
# class ResourceItem(Item):
#     @property
#     def resource(self):
#         return getattr(self.endpoint, 'resource', self.endpoint)
# 
# Path: hyperadmin/signals.py



from django import forms
from django.utils.datastructures import SortedDict
from django.template.defaultfilters import slugify
from hyperadmin.endpoints import VirtualEndpoint, GlobalSiteMixin
from hyperadmin.resources.hyperobjects import ResourceItem
from hyperadmin.signals import resource_event



class EmptyForm(forms.Form):
    def __init__(self, **kwargs):
        self.instance = kwargs.pop('instance', None)

# Path: hyperadmin/endpoints.py
# class VirtualEndpoint(BaseEndpoint):
#     '''
#     A type of endpoint that does not define any active endpoints itself
#     but references other endpoints.
#     '''
#     name_suffix = 'virtual'
# 
#     def get_children_endpoints(self):
#         return []
# 
#     def get_urls(self):
#         urlpatterns = self.get_extra_urls()
#         urls = [endpoint.get_url_object() for endpoint in self.get_children_endpoints()]
#         urlpatterns += patterns('', *urls)
#         return urlpatterns
# 
#     def get_extra_urls(self):
#         return patterns('',)
# 
#     def urls(self):
#         return self.get_urls(), self.app_name, None
#     urls = property(urls)
# 
#     def dynamic_urls(self):
#         return self, self.app_name, None
# 
#     @property
#     def urlpatterns(self):
#         return self.get_urls()
# 
#     def get_url_object(self):
#         return url(self.get_url_suffix(), include(self.urls))
# 
#     def create_link_prototypes(self):
#         '''
#         Inludes the link prototypes created by the children endpoints
#         '''
#         link_prototypes = super(VirtualEndpoint, self).create_link_prototypes()
# 
#         for endpoint in self.get_children_endpoints():
#             link_prototypes.update(endpoint.link_prototypes)
# 
#         return link_prototypes
# 
#     def get_index_endpoint(self):
#         raise NotImplementedError
# 
#     def get_main_link_name(self):
#         return self.get_index_endpoint().get_main_link_name()
# 
#     def get_url(self, **kwargs):
#         return self.get_index_endpoint().get_url(**kwargs)
# 
#     def generate_api_response(self, api_request):
#         """
#         Calls the index endpoint and returns it's api response
#         :rtype: Link or HttpResponse
#         """
#         endpoint = self.get_index_endpoint().fork(api_request=api_request)
#         return endpoint.generate_api_response(api_request)
# 
# class GlobalSiteMixin(object):
#     '''
#     Endpoints inheriting this class will default to the global site if
#     no site is passed in.
#     '''
#     global_endpoint = False
# 
#     def __init__(self, **kwargs):
#         if 'site' not in kwargs:
#             from hyperadmin.sites import global_site
#             kwargs.setdefault('site', global_site)
#             self.global_endpoint = True
#         super(GlobalSiteMixin, self).__init__(**kwargs)
# 
#     def urls(self):
#         if self.global_endpoint:
#             return self.get_urls(), self.app_name, self.site.namespace
#         return self.get_urls(), self.app_name, None
#     urls = property(urls)
# 
# Path: hyperadmin/resources/hyperobjects.py
# class ResourceItem(Item):
#     @property
#     def resource(self):
#         return getattr(self.endpoint, 'resource', self.endpoint)
# 
# Path: hyperadmin/signals.py



# Path: hyperadmin/resources/resources.py
from django import forms
from django.utils.datastructures import SortedDict
from django.template.defaultfilters import slugify
from hyperadmin.endpoints import VirtualEndpoint, GlobalSiteMixin
from hyperadmin.resources.hyperobjects import ResourceItem
from hyperadmin.signals import resource_event




class EmptyForm(forms.Form):
    def __init__(self, **kwargs):
        self.instance = kwargs.pop('instance', None)

        super(EmptyForm, self).__init__(**kwargs)