Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 7, 2010 15:38:44

Wayne S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin view


To fire off an action (method) after an object is saved, you want to listen
for its signal.

Check outhttp://docs.djangoproject.com/en/dev/topics/signals/On Mon, Dec 6, 2010 at 11:28 PM, commonzenpython
<commonzenpyt...@gmail.com>wrote:

> hey guys, im trying to get a script to run, like a view after a user
> in the admin interface checks a box and saves the object, is there any
> way of accomplishing this without having to rewrite the add_view, and
> edit_view ?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com<django-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
>http://groups.google.com/group/django-users?hl=en.
>
>

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 8, 2010 02:45:20

c.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

admin view


thanks for your reply, iv been reading the documentation, and wrote
the code, but theres one thing im having trouble with, i included the
signal connection in my models.py, and passed the model that was there
to the handler function so that it can be tied to that specific model,
like so

class foo(models.Model):
#model code here

def handler(sender=foo, **kwargs):
#code to be executed when model foo saved

post_save.connect(handler)

now, in the code to be executed i instantiate a class that imports
the model foo, but django wont import it

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 23rd of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support