[Fixed]-Adding urls/views to a model โ€“ Django Oscar?

1๐Ÿ‘

I had to add all the urls of the parent class.

class DashboardApplication(CoreDashboardApplication):
    ...
    catalogue_app = get_class('dashboard.catalogue.app', 'application')


    def get_urls(self):
        urls = super(DashboardApplication, self).get_urls()  
        urls += [
            url(r'^catalogue/', include(self.catalogue_app.urls)),
        ]
        return self.post_process_urls(urls)

Similarly for the other app.py

class CatalogueApplication(CoreCatalogueApplication):
    name = None
    csv_upload_view = get_class('dashboard.catalogue.views',
                                 'CSVUpload')

    def get_urls(self):
        urls = super(CatalogueApplication, self).get_urls()
        urls += [
            url(r'^csvupload/$',
                self.csv_upload_view.as_view(),
                name='csvupload'),
        ]
        return self.post_process_urls(urls)


application = CatalogueApplication()
๐Ÿ‘คCoderaemon

Leave a comment