Login

Tag "ownerfield"

Snippet List

OwnerField

This is a little helper for associating an owner to a newly created object, in this case making the assumption that the current user is always the owner. It removes the necessity of adding a custom save hook to your model. get_current_user comes from this middleware trick to cache the current user: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser

  • model
  • user
  • field
  • owner
  • ownerfield
Read More

1 snippet posted so far.