def get_urls(self):
        """
        Expose the custom URLs for the subclasses and the URL resolver.
        """
        urls = super(PolymorphicParentModelAdmin, self).get_urls()
        info = _get_opt(self.model)

        # Patch the change view URL so it's not a big catch-all; allowing all
        # custom URLs to be added to the end. This is done by adding '/$' to the
        # end of the regex.  The url needs to be recreated, patching url.regex
        # is not an option Django 1.4's LocaleRegexProvider changed it.
        if (1, 9) < django.VERSION:
            # On Django 1.9, the change view URL has been changed from
            # /<app>/<model>/<pk>/ to /<app>/<model>/<pk>/change/, which is
            # why we can skip this workaround for Django >= 1.9.
            new_change_url = url(
                r'^{0}/$'.format(self.pk_regex),
                self.admin_site.admin_view(self.change_view),
                name='{0}_{1}_change'.format(*info)
            )

            redirect_urls = []
            for i, oldurl in enumerate(urls):
                if oldurl.name == new_change_url.name:
                    urls[i] = new_change_url
        else:
            # For Django 1.9, the redirect at the end acts as catch all.
            # The custom urls need to be inserted before that.
            redirect_urls = [pat for pat in urls if not pat.name]  # redirect URL has no name.
            urls = [pat for pat in urls if pat.name]

        # Define the catch-all for custom views
        custom_urls = [
            url(r'^(?P<path>.+)$', self.admin_site.admin_view(self.subclass_view))
        ]

        # At this point. all admin code needs to be known.
        self._lazy_setup()

        # Add reverse names for all polymorphic models, so the delete button and "save and add" just work.
        # These definitions are masked by the definition above, since it needs special handling (and a ct_id parameter).
        dummy_urls = []
        for model, _ in self.get_child_models():
            admin = self._get_real_admin_by_model(model)
            dummy_urls += admin.get_urls()

        return urls + custom_urls + dummy_urls + redirect_urls
dataset/ETHPy150Open chrisglass/django_polymorphic/polymorphic/admin.py/PolymorphicParentModelAdmin.get_urls/swapped operands of `<`