Code Monkey home page Code Monkey logo

Comments (3)

triat avatar triat commented on July 30, 2024

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.

avelis avatar avelis commented on July 30, 2024

@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.

ataylor32 avatar ataylor32 commented on July 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.