Comments (3)
Hello @ataylor32, actually all this things could be managed through the groups and not a params in the settings.
Or maybe I don't understand correctly what you want, sorry
from drf-tracking.
@ataylor32 Admin editability can depend on a per user basis. Dictating it one way probably isn't the best idea. Now are people using the admin to edit track records is a whole other question. For high volume customers this wouldn't make sense much. Be better to handle it via the ORM.
Per app permissions can be handled with Django auth groups/permissions I haven't used that and wouldn't be able to prescribe a solution right away. There is django guardian but that introduces another level of complexity.
If you really need the model edit view to have read only fields you can import the admin class into a file that will be picked up during app load and set as follows:
from rest_framework_tracking.admin import APIRequestLogAdmin
APIRequestLogAdmin.readonly_fields = ('body', )
@ataylor32 All these solutions above can be achieved without new changes to the library. Always open to changes if you have a PR that represents what you are looking for in spirit.
from drf-tracking.
Thanks for the replies! I understand where you're coming from. If you want to leave things the way they are then I respect that. I'd like to explain my thinking, though.
I don't know why anybody—superuser or not—would need to add or edit a drf-tracking record. The purpose of drf-tracking, as I understand it, is to log real requests made to the site's API. If somebody adds or edits a record from the admin then drf-tracking will have inaccurate information since the record won't be a representation of a real request.
I think it makes sense to have the most likely configuration be the default configuration and if somebody wants to override it then they can. So, in my opinion, drf-tracking's default configuration should be that records cannot be added or edited from the admin. If somebody really wants to be able to add or edit drf-tracking records from the admin (and, again, I don't know why they would) then they can enable that themselves. That's just my opinion, though.
from drf-tracking.
Related Issues (20)
- Log Construction HOT 1
- LogginMixin not gets called with ModelViewSet in Django 2.0.4 HOT 3
- Migrations conflict HOT 4
- When I get an api and there will always be 2 logs at a time HOT 1
- How to do drf tracking write in async thread HOT 1
- django 2 compatible HOT 3
- Can we track django-oauth-toolkit client?
- Failed Clean data when uploading file as form-data HOT 2
- Only last params value is captured if multiple query params are sent with same key
- why this line is needed? HOT 4
- UnicodeDecodeError on python 2.7 / django 1.11 HOT 2
- Feature Request: Skip logging the response HOT 1
- PIP (pypi) is not updated HOT 5
- Add city & country data to the log HOT 1
- Some requests are not recorded HOT 2
- requested_at and remote_addr fields in base_model are not null HOT 1
- Fix missing query_params on Put/Post/Patch requests. Update tox tests to include django 2.2.6 and drf 3.10.3 versions HOT 5
- Can we publish a new release? HOT 14
- Azure proxy config throws psycopg2 exception HOT 6
- Django version 3.x has not "django.utils.six" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drf-tracking.