Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin view + custom relationships #161

Open
wants to merge 190 commits into
base: master
Choose a base branch
from
Open

Conversation

aleontiev
Copy link
Collaborator

@aleontiev aleontiev commented Mar 30, 2017

Large set of changes to support advanced admin functionality in the admin renderer.

API layer:

  • Added support for self-links, which allows downstream code or consumers to easily identify the PK and type of a record
  • Added support for bulk create via CSV file upload

Admin renderer:

  • Relationship fields automatically render as hyperlinks in the admin view, using the serializer's natural key
  • Added Import CSV option to list view
  • Added proper DynamicRelationField support, using select2 with query on natural key
  • Various design / layout changes

Internals:

  • Made serializer_class optional on DynamicRelationField. If not passed, DREST will infer the serializer using DynamicRouters registry (map of model -> canonical serializer for that model)
  • Added getter/setter support on DynamicRelationField. If specified, DREST will call the given methods to get and set relationship values instead of using the model source. This is useful for e.g. higher level APIs that want to hide complicated internal modeling. Unlike DynamicMethodField, a DynamicRelationField with a getter will be automatically properly serialized and will support include[] and exclude[]
  • Added an internal post-save hook to support DynamicRelationField setter for many-relations
  • Added a get_url method to serializers, which will resolve the serializer's endpoint based on the first registered viewset. Works even if the serializer is not canonical, but will fall back to using DynamicRouter's map of canonical serializers
  • Introduced the concept of "natural key" for serializers, a single field that can display a human-friendly string representation for a serializer

aleontiev and others added 30 commits February 28, 2017 14:55
@nnegri
Copy link

nnegri commented Oct 9, 2017

@ryochiji @aleontiev We want to perform frontend regression testing on the feature deploy for the admin product, so I rebased vishnu-backend from master to take into account the new ufd login redirect change from last week (Zoe needs a reliable login flow for some of her tests). I'm now getting a circle failure for dynamic_rest/test.py on instance.save() in create_instance. Is this something you can address from here, or do you recommend I work around this somehow?

@auvipy
Copy link

auvipy commented Oct 19, 2017

when we can try the 2.0 version? did you add drf 3.7 compat for 2.0 release?

@auvipy
Copy link

auvipy commented Apr 7, 2018

sorry for bugging! can anyone give any idea about this work? will this ever be merged? what helps needed to complete this?

@auvipy
Copy link

auvipy commented Jul 21, 2018

@aleontiev do you have plan to complete this? or it would be ok to take over?

@aleontiev
Copy link
Collaborator Author

@auvipy, I've left the org and have since forked the project here, where I have continued most of this work. Would love to merge in to the main project at some point, time permitting :)

@auvipy
Copy link

auvipy commented Mar 22, 2019

@aleontiev I would love to help in maintaining this package :) you could add me as a co maintainer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants