Hi,

I am trying to figure out the best way to deal with object/user centric
object creation. I am building a site that lets users create objects
tied to their identities, for e.g. having users posting news entries,
etc.

Currently one can make a wrapper to deal with checking a user's access
for viewing (object_detail), editing (update_object), and deleting
(delete_object), since we have an object instance which we can fetch
and do some tests on, prior to handing it to a generic view. (or better
yet, dealing with object.related_set)  (this is discussed on
http://www.b-list.org/weblog/2006/07/03/django-tips-scaling-application
and
http://www.pointy-stick.com/blog/2006/06/29/django-tips-extending-generic-views/
)

Unless I am mistaken, one cannot use the create_update.create_object
function with one of the model's fields pre-populated (in this case,
user_id/author_id). This is unfortunate, since it means making a custom
function for object creation.

I am trying to figure out a way to build a generic function for
relational object creation. i.e. being able to call something like
create_update.create_object(model=Post,relation=user.post_set) so the
function could call relation.create(instance based on form data). This
would also hide/ignore the POSTed settings which are immutable (i.e.
user's id)

Am I missing something, or is this possibly something that should go
into generic views, or should I code my own function? Can it be made
generic enough.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to