# Path: wagtailplus/wagtailaddresses/app_settings.py
# ADDRESS_ATTR_MAP        = getattr(settings, 'ADDRESS_ATTR_MAP', DEFAULT_ADDRESS_ATTR_MAP)
# 
# Path: wagtailplus/wagtailaddresses/views/choosers.py
# class ChooseAddressView(chooser.ChooseView):
# class CreateAddressView(chooser.CreateView):
# class ChosenAddressView(chooser.ChosenView):
# class BaseComponentView(object):
# class ChooseComponentView(BaseComponentView, chooser.ChooseView):
# class CreateComponentView(BaseComponentView, chooser.CreateView):
# class ChosenComponentView(chooser.ChosenView):
# class UpdateComponentView(BaseComponentView, chooser.UpdateView):
#     def get_context_data(self, **kwargs):
#     def get_queryset(self):
#     def get_search_filters(self):
#     def get_form_kwargs(self):
#     def get_queryset(self):


from django.conf.urls import url
from .app_settings import ADDRESS_ATTR_MAP
from .views import choosers

Contains address-related utilities.
"""



def get_component_urls():
    """
    Returns list of address component URLs based on address attribute map.

    :rtype: list.
    """
    component_patterns = []
    
    for component, label in ADDRESS_ATTR_MAP.iteritems():
        label           = unicode(label)
        chooser_name    = 'wagtailaddresses_{0}_chooser'.format(component)
        create_name     = 'wagtailaddresses_{0}_create'.format(component)
        
        component_patterns.append(url(
            r'^{0}-chooser/$'.format(label.lower().replace(' ', '-')),
            choosers.ChooseComponentView.as_view(
                comp_type=label,
                chooser_name=chooser_name,
                create_name=create_name
            ),
            name=chooser_name
        ))
        
        component_patterns.append(url(
            r'^{0}-chooser/create/$'.format(label.lower().replace(' ', '-')),

# Path: wagtailplus/wagtailaddresses/app_settings.py
# ADDRESS_ATTR_MAP        = getattr(settings, 'ADDRESS_ATTR_MAP', DEFAULT_ADDRESS_ATTR_MAP)
# 
# Path: wagtailplus/wagtailaddresses/views/choosers.py
# class ChooseAddressView(chooser.ChooseView):
# class CreateAddressView(chooser.CreateView):
# class ChosenAddressView(chooser.ChosenView):
# class BaseComponentView(object):
# class ChooseComponentView(BaseComponentView, chooser.ChooseView):
# class CreateComponentView(BaseComponentView, chooser.CreateView):
# class ChosenComponentView(chooser.ChosenView):
# class UpdateComponentView(BaseComponentView, chooser.UpdateView):
#     def get_context_data(self, **kwargs):
#     def get_queryset(self):
#     def get_search_filters(self):
#     def get_form_kwargs(self):
#     def get_queryset(self):


# Path: wagtailplus/wagtailaddresses/utils.py
from django.conf.urls import url
from .app_settings import ADDRESS_ATTR_MAP
from .views import choosers

Contains address-related utilities.
"""



def get_component_urls():
    """
    Returns list of address component URLs based on address attribute map.

    :rtype: list.
    """
    component_patterns = []
    
    for component, label in ADDRESS_ATTR_MAP.iteritems():
        label           = unicode(label)
        chooser_name    = 'wagtailaddresses_{0}_chooser'.format(component)
        create_name     = 'wagtailaddresses_{0}_create'.format(component)
        
        component_patterns.append(url(
            r'^{0}-chooser/$'.format(label.lower().replace(' ', '-')),
            choosers.ChooseComponentView.as_view(
                comp_type=label,
                chooser_name=chooser_name,
                create_name=create_name
            ),
            name=chooser_name
        ))
        
        component_patterns.append(url(
            r'^{0}-chooser/create/$'.format(label.lower().replace(' ', '-')),

            choosers.CreateComponentView.as_view(
