another alternative you may want to consider is to piggybak ontop of the generic view have a look at http://svn.zyons.python-hosting.com/trunk/zilbo/common/utils/views/create_update.py for a example which adds a 'change_user' and 'last_change' fields eg. if request.POST: new_data = request.POST.copy() now = datetime.datetime.today() new_data['last_change_user_id'] = str(request.user.id) new_data['last_change_user'] = new_data['last_change_user_id'] new_data['last_change_date'] = now.strftime('%Y-%m-%d') new_data['last_change_time'] = now.strftime('%H:%M:%S') new_data['create_user_id'] = new_data['last_change_user_id'] new_data['create_user'] = new_data['last_change_user_id'] new_data['creation_date_date'] = now.strftime('%Y-%m-%d') new_data['creation_date_time'] = now.strftime('%H:%M:%S') request._post = new_data return create_object(request, model, template_name, template_loader, extra_context, post_save_redirect, login_required, follow) so in your case I would handle the 'tag' field here, and split it into multiple fields which the normal changemanipulator can handle. and it uses all the goodness of the generic update, without me having to duplicate the code. regards Ian On 08/08/2006, at 2:45 AM, jeffmikels wrote:
-- Ian Holsman http://peopleintopoker.com/ -- where the poker people go --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~--- |
- Re: Using custom forms with generic views Gábor Farkas
- Re: Using custom forms with generic views Ian Holsman
- Re: Re: Using custom forms with generic views Jeff Mikels