James,
I don't think model should know anything about request like is IP
address. This would violate MVC principle.

Bojan

On May 29, 1:25 am, JamesJOG <ja...@jarofgreen.co.uk> wrote:
> I have a model with an IPAddressField (1) and some views that have to
> write to that field every time they save (2) ... Wouldn't it be nice
> if I could just specify auto_now=True or auto_now_add=True in the
> model and let Django take care of that for me, the same as I can for
> date fields?
>
> I've only been using Django for a month, I don't know if this is to
> hard. You would also have to assume an IP address of localhost when it
> was being used in a non-web environment like the shell.
>
> So far I'm very impressed with the framework, thanks everyone ....
> James
>
> 1.  http://github.com/jarofgreen/TaggedWiki/blob/8e58808a85e9f2f3f8cee8cf...
> line 47
> 2.http://github.com/jarofgreen/TaggedWiki/blob/8e58808a85e9f2f3f8cee8cf...
> lines 103 & 128
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to