Package: django-tabbed-admin2
Django Tabbed Admin2This is a fork of the old Django tabbed admin, available atomji/django-tabbed-admin.InstallationIt is strongly recommended to install this theme from Git using PIP in your project's virtual environment.From PyPipipinstalldjango_tabbed_admin2From GitHubhttps://github.com/omji/django-tabbed-admin#egg=tabbed_adminSetupSimply add the app to your list of installed apps insettings.py.INSTALLED_APPS=(...'django_tabbed_admin2',...)Django-tabbed-admin, by default, requires the Jquery UI tabs plugin to work. It is packaged with the static files required for functionality, but they are not activated by default to avoid conflicts with other libraries.To activate the Jquery UI statics, add the following line to the project settings:TABBED_ADMIN_USE_JQUERY_UI=TrueConfigure Admin TabsTo add tabs to a model admin, it should inherit fromtabbed_admin.TabbedModelAdminand contain atabsattribute. Thetabsattribute configuration is similar to thefieldsetsandinlinessetup logic.A tuple can be created for each tab in the same way as forfieldsets, except thatinlinescan be added anywhere in between.tab_overview=((None,{'fields':('name','bio','style')}),MusicianInline,('Contact',{'fields':('agent','phone','email')}))Then each tuple has to be passed to atabsattribute prefixed by the verbose name to display within the tab:tabs=[('Overview',tab_overview),('Albums',tab_album)]A full example would be:fromdjango.contribimportadminfromtabbed_adminimportTabbedModelAdminfrom.modelsimportBand,Musician,AlbumclassMusicianInline(admin.StackedInline):model=Musicianextra=1classAlbumInline(admin.TabularInline):model=Albumextra=1@admin.register(Band)classBandAdmin(TabbedModelAdmin):model=Bandtab_overview=((None,{'fields':('name','bio','style')}),MusicianInline,('Contact',{'fields':('agent','phone','email')}))tab_album=(AlbumInline,)tabs=[('Overview',tab_overview),('Albums',tab_album)]Configure Tabs DynamicallyBe warned that the tabs will completely reset thefieldsetsandinlinesattributes to avoid conflicts during form saving. Both attributes are overwritten with the entries passed to thetabsattribute. For the same reasons, it is highly recommended not to overwriteget_fieldsetsorget_inlines.You can pass and modify the tabs dynamically the same way you would do forfieldsetsorinlines.defget_tabs(self,request,obj=None):tabs=self.tabsifobjisnotNone:tab_overview=self.tab_overview+('Social',{'fields':('website','twitter','facebook')})tab_ressources=self.tab_ressources+(InterviewInline,)tabs=[('Overview',tab_overview),('Ressources',tab_ressources)]self.tabs=tabsreturnsuper(BandAdmin,self).get_tabs(request,obj)Change the Jquery UIYou can change the Jquery UI CSS and JS by either overriding the media in the admin class:classMedia:css={'all':('css/jquery-ui.theme.min.css',)}or by changing the following settings,TABBED_ADMIN_JQUERY_UI_CSSandTABBED_ADMIN_JQUERY_UI_JS:TABBED_ADMIN_JQUERY_UI_CSS='static/css/my-custom-jquery-ui.css'TABBED_ADMIN_JQUERY_UI_JS='static/js/my-custom-jquery-ui.js'ContributionPlease feel free to contribute. Any help and advice are much appreciated. You will find an example application to run and develop the library easily.LinksDevelopment:https://github.com/4Sigma/django-tabbed-admin