django


Django Rest Framework and django.contrib messages


How can I integrate calls to DRF Generic Views functions like perform_create, perform_update, perform_destroy so that the resulting response contains a message added by using django.contrib messages framework?
so far i have this:
def perform_destroy(self, instance):
try:
instance.remove()
messages.success(self.request._request,
'Delete successful')
except Exception as e:
messages.error(self.request._request, e)
the message appears correctly when the page is reloaded but I cannot access it directly with this function response.
Thanks for any help

Related Links

Many to many - proper usage
Django administration panel filter list
django catching http-referer not working always
Django 1.7 - serving CSS static files in development
Docker, web app static files. Best practices?
Django Serializers many to many relationship
GeoDjango: transform SRID in DRF Serializer
Should the response argument to `process_response` always be a subclass of HttpResponse?
Django serve get-requests
Django ChoiceField initial setup not working
How do I override the email template for django postman?
Fields in apache solr response are multivalued when they should be singular
Django cors headers and server error
DjangoRestFramework - How to pass a serializer form to the frontend?
Where in Django project to store a single image file that is never served to the user
Correct way of rewriting `forms.ChoiceField` into a ModelField? Is it models.ForeignKey?

Categories

HOME
go
beautifulsoup
gridview
scikit-learn
c++11
dns
rsa
composite-primary-key
access
hpc
elasticsearch-5
sendgrid-api-v3
32bit-64bit
ibeacon-android
watson-conversation
windows-ce
mxgraph
shared-libraries
libusb
cfml
nim
asp.net-core-webapi
replication
microsoft-ocr
user-experience
visual-glitch
angular-routing
joptionpane
pchart
roundup
strongname
winexe
ceylon
cppreference
kudu
testbed
twos-complement
reverse
mnist
openproject
google-knowledge-graph
sim-card
numberpicker
tasm
trigonometry
watchface
parser-generator
logback-groovy
apollostack
knime
opencmis
dynamic-linq
opennms
term
hammer.js
configurationmanager
singleinstance
arq
amq
opengl-4
janus
cmp
stax
redbeard-ios
mongodb-php
xdoclet
simevents
phpgrid
rasterize
opl
forwarding
page.js
batik
sql-server-data-tools
mirror
nsurlsessiondatatask
matlab-deployment
uvc
public-html
apache-spark-1.3
dbaccess
showdialog
cocos3d
formview
entry-point
psr-4
jjaql
ray
maven-scm
android-audiorecord
nevron
pagedown
insert-id
windows-98
veracity
window-decoration
htdocs
automationelement
appledoc
qglwidget
non-clustered-index
maven-1
eclipse-marketplace
application-verifier
echo3
purepdf
dsl-tools
cuda.net
perl5.12
fdf
application-planning
sqlobject

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App