jazzband / django-admin2 Goto Github PK
View Code? Open in Web Editor NEWExtendable, adaptable rewrite of django.contrib.admin
License: BSD 3-Clause "New" or "Revised" License
Extendable, adaptable rewrite of django.contrib.admin
License: BSD 3-Clause "New" or "Revised" License
This is taken from django.contrib.admin.init.py and https://github.com/pydanny/django-mongonaut/blob/master/mongonaut/mixins.py#L54.
It works in those places but on my test project it fails.
This: https://github.com/opencomparison/opencomparison/blob/master/docs/contributing.rst
Needs to be brought into our documentation directory.
We should drop 2.6 from travis since we don't support it.
I started working on https://github.com/AndrewIngram/django-dashbuilder a while back. I didn't get that much done, but the basics of model editing is in place. The key thing that's missing is permissions. There might be some ideas or solutions you can steal.
We have a mix of modeladmin and model_admin. We really need to be consistent.
This: https://github.com/opencomparison/opencomparison/blob/master/docs/contributing.rst
Needs to be brought into our documentation directory.
contributing.rst
file.One way to provide support for commonly used django apps (like contrib.auth) would be to ship a simple package (admin2-legacy or something) that just tries to register those other apps with admin2.
If the view, which is called by the urls generated by the ModelAdmin object and yet receives a reference to the ModelAdmin as passed in as_view() modifies the state of the ModelAdmin object, then everyone sees that new data.
This can be mitigated in three ways:
Occurs: models.ModelAdmin2.get_default_view_kwargs
Right now there is no documentation outlining the design of the project.
Some questions that come to mind:
...
If this kind of document already exists it would be great if it was added to the repo.
We should provide a simple way to rearrange/group fields in the admin without creating custom templates.
The current admin offers this functionality via fieldsets in a rather specific way.
We could look at how crispy form layouts does this stuff where you can go ahead and do stuff like this:
layout = Row(Span("name", "age"), Span("email", "phone"))
This would make it easy to produce nice form layouts without having to drop into the template
for simple modifications.
For more details see http://django-crispy-forms.readthedocs.org/en/d-0/layouts.html
Just like the old admin. I've got a branch with this implemented, I just need to get the formset rendering working in a readable fashion. Putting this here so you know it's being worked on
https://github.com/AndrewIngram/django-admin2/tree/inline-formsets
I've not been at the sprints, so this may well have been discussed already.
Wanting to contribute, I started looking at implementing the admin auth urls (login, logout, password change, etc.). As I worked, it became clear that I was duplicating a lot of functionality from the original AdminSite class from contrib.admin. The only added 'feature' was incorporating ADMIN2_THEME_DIRECTORY into the template path.
It seems to me that if Admin2 subclassed AdminSite, we'd get a good bit of functionality for free. AdminSite implements all of the auth urls, Admin2 would only have to override get_urls, and change all of the template names as class attributes.
At first glance, it seems as if we might also be able to re-use at least some of the permissions code from AdminSite as well.
I've written a quick spike which takes the approach outlined above. All tests pass, after only having to change the test that counts the number of admin urls.
Note I had to refactor the settings file into separate files, since having django-debug-toolbar in INSTALLED_APPS was breaking the admin login test (specifically, the redirect intercepts). Ideally, settings would be a package, but I didn't want to break existing environments that might rely on DJANGO_SETTINGS_MODULE=example.settings.
We should use i18n in all templates so we can translate it later on.
We need something simple. It should have:
We need some way to specify which views are available for a certain admin.
It might make sense to have something like a get_menu_entries() method on the
admin instance that returns the urls + verbose names for all available views.
This would be used to build menus, dashboards and these kinds of things.
Also when extending the admin you could just add a new menu entry for additional custom views.
models.Model.Meta.model
attribute assignedOut of the box it would be nice if these were displayed with attractive bootstrap widgets
On the create model page, implement the 'Save and add another', 'Save and continue editing', and 'Save' options from the original admin.
runserver.sh
needs a shebang line.
http://127.0.0.1:8000/admin2/blog/post/ should look more like http://127.0.0.1:8000/admin/blog/post/, except with Bootstrap components
My docs update didn't show up on http://django-admin2.readthedocs.org/en/latest/ - please update.
In models.py
we define several methods for determining whether a user has permission on a view (eg has_view_permission
). These methods don't offer very fine-grained control. Should we use the the has_perm
method from contrib.auth
as is done in the original admin in options.py
?
This either needs to be made to function, or documented so it's understandable how to implement the following use cases
Use Case 0: (Django default)
Use case 1:
Use case 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.