Thanks Russell, I'm start thinking this way too, after the time spent trying to hack the Admin. Hopefully I will obtain some results in a week or two, with generic views, and of course now or in the future I' need to begin building my application without relying on the Admin. I Hope. Picio
2006/11/11, Russell Keith-Magee <[EMAIL PROTECTED]>: > > On 11/10/06, Picio <[EMAIL PROTECTED]> wrote: > > > > Hello, > > I'm searching for ways to filter query_set inside the admin interface, > > without hacking It. Do you think is It possible through so template > > tags? > > Well.. yes, but it's the wrong way to solve the problem. You _could_ > write a template tag that takes arguments and passes them to a query > set. However, this would be a bad idea, as it requires you to start > mixing view logic into templates. > > The real solution is to write your own view in user space that has the > queries you want. > > There seems to be a popular view that the admin pages are somehow > magic, and that writing your own views is hard, and that the easiest > solution for every problem is to 'hack the admin view' to make it > useful for whatever end-user problem exists. > > Seriously - the admin view isn't magic. It is made up of fairly > ordinary generic views, and a couple of pretty templates. The only > slightly difficult bit is the fact that it dynamically determines all > the available models in the database. However, if you are developing > your own site, you don't need this sort of dynamic discovery - it's > just as easy to set up your urlpatterns manually on a per-applicaiton > basis. > > It will almost _always_ be easier to write your own view (or set up a > generic view) than to 'hack' the admin view. If you are really smart > about it, you can continue to use the pretty admin templates in your > own views. > > The admin view is there as a convenience for (strangely enough) > administration, not as a baseline that can be tweaked to produce a > deployable application. Django isn't Zope - Django is a framework for > building new applications, not a Zope-like application that only > requires configuration before deployment. > > 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 -~----------~----~----~----~------~----~------~--~---