I have a model for which I only allow POST requests for some users (no GET 
or other method).  I am using `viewsets.ModelViewSet` and 
`serializers.HyperlinkedModelSerializer`.  With my own simple custom 
permission class, I have been able to achieve this by implementing 
`has_permission`.  On the view set list page, there is no HTML form with 
which the user can POST.  It only appears if I allow GET.  This is a minor 
annoyance, but not a big deal to me.  The form does appear after a 
successful POST, just below the created object.

When the HTML form is visible, it shows the relevant fields as expected.  
One of these fields is a ForeignKey.  I want to be able to filter the 
dropdown list shown for this ForeignKey field.  Can I do this?  I have 
already filtered it in the foreign key's view set, but I guess I need a 
filter backend specific to this foreign key, and I'm not sure how to do 
that.

If I can't filter the list in the drop down, I would like to disable the 
HTML form.  Can I do that?

Thanks,
Jayen

-- 
You received this message because you are subscribed to the Google Groups 
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to