QuerySet for view from RawQuerySet (lacks _clone), or select_related with M2M?

2010-05-25 Thread Jeff Kowalczyk
I am trying to use a raw sql query in a model manager method. RawQuerySet lacks method _clone, is there a recommended way to return a normal QuerySet for views to consume? The models are included below. If there is a way to get the Django ORM to make the M2M join via select_related and extra, I'd

Re: Model with CharField primary key, force_update=True to prevent saving other object

2008-12-23 Thread Jeff Kowalczyk
Jeff Kowalczyk wrote: > I'm working with a model using a CharField primary key, ... > I need to prevent other objects from being created/updated > if save() is called with a changed pk value. > > class Widget(models.Model): >     identifier = models.CharField(primary_key=

Model with CharField primary key, force_update=True to prevent saving other object

2008-12-22 Thread Jeff Kowalczyk
I'm working with a model using a CharField primary key, and want to ask whether it is appropriate to use force_update=True in a save() override on the model. I need to prevent other objects from being created/updated if save() is called with a changed pk value. class Widget(models.Model): ide

Re: Delete multiple items from an admin change list

2008-12-19 Thread Jeff Kowalczyk
On Dec 19, 6:15 am, bcurtu wrote: > Is it possible to get the admin item list with a kind of checkboxes in > order to select multiple items and delete them all together? http://code.google.com/p/django-batchadmin/ --~--~-~--~~~---~--~~ You received this message be

Re: Multiple apps extending admin/change_list.html

2008-12-18 Thread Jeff Kowalczyk
Malcolm Tredinnick wrote: > So let's fall back to first principles: always construct the smallest > case possible that repeats the failure. This means start with a template > that includes nothing but the "extends" of the batchadmin template. If > that works, you can start adding in the other lin

ModelAdmin list_filter presets: usability best practice?

2008-12-15 Thread Jeff Kowalczyk
Does anyone have a best-practice suggestion for ModelAdmins which are best used with a preset list_filter? Put another way, where are the best usability customization points so the user sees a specific list filter when entering that modeladmin, and when being redirected after various actions, but

Re: Multiple apps extending admin/change_list.html

2008-12-15 Thread Jeff Kowalczyk
On Dec 13, 9:31 pm, Malcolm Tredinnick wrote: > That sounds like the only way. If you want to see batchadmin's changes, > you have to extend from that. Thank you, I have made batchadmin find its media in my development setup. My change_list.html, which now extends batchadmin/change_list.html, i

Multiple apps extending admin/change_list.html

2008-12-13 Thread Jeff Kowalczyk
I am developing an app with a customized admin/change_list.html [1]. I added djang-batchadmin, which itself has a template extending admin/ change_list.html (batchadmin/templates/batchadmin/change_list.html) What is the most effective pattern to manage multiple apps extending the same admin templ

How to use Fixtures and/or Initial SQL for project auth_user data?

2008-12-05 Thread Jeff Kowalczyk
During early prototyping, I'm relying on specific auth_user content in the project admin, as my app model use User as a ForeignKeyField. Project layout is:myproject/myapp Initial SQL myproject/myapp/mymodel/sql/mymodel.sql works fine, and I'm interested in initial_data.[xml/yaml/json for the sam

AuditTrail with Django-1.0 Admin: how to define type() as dj.c.admin.autodiscovered module attribute?

2008-12-05 Thread Jeff Kowalczyk
For AuditTrail [1] to appear in Django-1.0.x Admin, I need to define a ModelAdmin subclass as a module attribute. The current version of AuditTrail still uses the Admin class attribute. How can I set the result of type('FooAdmin',admin.ModelAdmin) as a module attribute that will be located by dja