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

Django many-to-many 'str' object has no attribute '_meta'
Reverse for 'places' with arguments '('l', 'o', 'n', 'd', 'o', 'n')' and keyword arguments '{}' not found
How to clear a database on OpenShift
Restrict urls on certain apps in Django
django allauth ImportError at /admin/ No module named context_processors
Choosing from two instances of the same form in Django post-request
Django join like queries
Deploy Django app with Docker
Django join query for permissions and group?
Django: Add & delete extra input field using class view at a click of a button
Elastic beanstalk Django POST: CSRF verification failed. Request aborted
Django UnitTest with multiple databases
Getting Lowest Used Price with Amazon API
Django email, name - not null, not empty, without default
Tree Database Design in Django for Organisation Feature
Django - update_or_create

Categories

HOME
service-worker
linkedin
pascal
gradient
hpc
zip
little-proxy
ycsb
magnetic-cards
bitnami
do-while
dimensional-modeling
dreamweaver
easyphp
google-data-studio
google-picker
xmonad
sigma.js
libigl
visual-studio-extensions
perlbrew
windows-server-2003
opentk
nstimer
constexpr
paragraph
mustache
laravel-eloquent
installscript
python-import
browser-extension
imx6
salesforce-communities
xcode7.3
cd
opensmpp
visa
lpsolve
bindingnavigator
smoothstate.js
xmldocument
signal-strength
optimizely
openresty
carrot2
context-sensitive-grammar
oracleclient
colorbar
filehandle
check-mk
payload
pybrain
docpad
autosar
envi
segment-io
kiosk
uiactionsheet
lz77
directdraw
custom-errors
dynatree
android-launcher
liquid-layout
gamekit
code-documentation
grouping-sets
variadic-templates
device-tree
with-statement
named-parameters
rcaller
websphere-esb
conditionaltagsupport
drupal-nodes
gwt-openlayers
away3d
cffile
poker
pagedown
traceability
cascadingdropdown
swfobject
twisted.web
bjyauthorize
android-loadermanager
monotouch.dialog
web-farm
appjs
database-create
predicatebuilder
google-maps-mobile
diagrams
hbm2java
zend-rest

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