On Feb 7, 6:38 am, Joel Goldstick <joel.goldst...@gmail.com> wrote:
> can you use the http request object: > > http://docs.djangoproject.com/en/dev/ref/request-response/#quick-over... I think the problem there is that the HttpRequest object isn't available by default to the post_save signal. Some of the ways you might get access to the ip... Add an ip field to your model and then when processing the POST in your view attach the ip to your instance then save. I used this method myself for a discussion model that tracks the ip of the poster. If you don't want to store the ip you might try ( untested ) attaching the ip as an attribute to the model instance similar to above and see if the attribute survives to the post_save signal. You could also try something similar to the above with the instance save method but then you wouldn't be handling it at post_save. You could also create your own signal system for use when processing the POST in your view that handles your ip address needs. It all depends on what you want to do with the ip address. If you let us know more about what of your situation we might be able to give your more ideas. Toodle-loooooooooooooo creecode -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.