<div dir="ltr"><div>I need some design input. To store AccessPolicy data in the DB I think we want one Model where each instance is the access policy for a given viewset. I think this would be better than one Model per Viewset which would generate N tables for N viewsets with 1 instance of each which would be very strange and inefficient.</div><div><br></div><div>So let's assume we have a simple definition like the one below. Each instance stores the policy for one viewset.<br></div><div><br></div><div>class AccessPolicy(BaseModel):<br>    data = JSONField()</div><div><br></div><div>So what second field can I add to this that would allow me to relate an instance of this model to a viewset. For example the FileRemoteViewset here: <a href="https://github.com/pulp/pulp_file/blob/de638519fc02d588f403db4c5cfcca7552543c50/pulp_file/app/viewsets.py#L116">https://github.com/pulp/pulp_file/blob/de638519fc02d588f403db4c5cfcca7552543c50/pulp_file/app/viewsets.py#L116</a></div><div><br></div><div>Idea 1: Add a viewset = CharField(). Have it store values as URLs, e.g. /pulp/api/v3/remotes/file/file/.</div><div>Idea 2: Add a viewset = CharField(), and have it store values as classpaths, e.g. 'pulp_file.app.viewsets.RemoteFileViewset'.</div><div><br></div><div>I think Idea 1 makes the most sense because that's how our users think of it. I can't think of a good alternative. What do you think makes the most sense? What alternative ideas should we consider?</div><div><br></div><div>If you have feedback please share it. I need to start into something to get it going tomorrow even if it's just Idea 1 for lack of an alternate proposal.<br></div><div><br></div><div>Thanks,</div><div>Brian<br></div></div>