Re: Feature request: Generic add/change features (similar to admin)
Thanks Russ. I had seen that, but documentation was scarce and I wanted a faster method (no template writing, django admin css and templates are good enough for my app, no need to recode). It took me a little while, but I've now switched completely to to generic::create_object(). Compared to admin::add_stage(), here are the issues that I faced: - doesn't work out of the box, needs a template and css (can be quite long to create) - related objects a little difficult to bolt-in - error handling/input validation code needs to be sprinkled across the template AFAICT - no support for "Cancel", "Save and continue editing" and "Save and add another" but otherwise, works great, lots of flexibility, especially related objects can be integrated at a much lower level of granularity once. Thanks again, JJ. On May 22, 1:31 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 5/21/07, jj <[EMAIL PROTECTED]> wrote: > > > Wouldn't it be cool ifgenericviews supportedadd/change out of the > > box, and the only code to write was a 1-liner equivalent to admin's > > "fields=(...,)"? Could the current admin rewrite be the occasion to > > factor out this functionality and make it more widely available? > > You mean, something like: > > http://www.djangoproject.com/documentation/generic_views/ > > ? > > Django admin already _is_ refactored in exactly the way you describe. > I've said this before, and I'll say it again - Django's admin view > isn't magic. It's just a pre-templated, introspective use of the tools > that are available to everyone. > > Yours, > Russ Magee %-) --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Feature request: Generic add/change features (similar to admin)
On 5/21/07, jj <[EMAIL PROTECTED]> wrote: > Wouldn't it be cool if generic views supported add/change out of the > box, and the only code to write was a 1-liner equivalent to admin's > "fields=(...,)"? Could the current admin rewrite be the occasion to > factor out this functionality and make it more widely available? You mean, something like: http://www.djangoproject.com/documentation/generic_views/ ? Django admin already _is_ refactored in exactly the way you describe. I've said this before, and I'll say it again - Django's admin view isn't magic. It's just a pre-templated, introspective use of the tools that are available to everyone. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Feature request: Generic add/change features (similar to admin)
One of the best features of Django admin is the ability to add and edit objects without writing any code OR template. However, no such built-in functionality on the non-admin part of the site. Everyone has to reimplement it on its own, which is cumbersome and difficult to get right or as good. Wouldn't it be cool if generic views supported add/change out of the box, and the only code to write was a 1-liner equivalent to admin's "fields=(...,)"? Could the current admin rewrite be the occasion to factor out this functionality and make it more widely available? JJ. PS. I'm currently importing and reusing "add_stage" and "change_stage". However, this poses a number of issues, for example: - "fields" are shared by add_stage and change_stage, both admin and non-admin. Modifications to one impact the others. - the add/change_stage template contains admin specific headers - it relies on ../../jsi18n, which is absent in the non-admin area - ... --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---