django.conf.settings.get()

2011-05-07 Thread David Cramer
Ticket speaks for itself: http://code.djangoproject.com/ticket/10098 My vote is to reopen it, as this is very common, easy to implement, and very unlikely that it would ever need deprecated. -- You received this message because you are subscribed to the Google Groups "Django developers" group.

Re: get_or_create can still cause IntegrityError

2011-05-07 Thread David Cramer
We hit this same issue in Postgres (it's definitely not MySQL specific). I'm unsure of the solution or precise conditions we're hitting it in, but I think by default we use READ COMMITTED. On May 7, 3:28 am, Tomasz Zielinski wrote: > I think that get_or_create is still broken, despite this > fix

Re: get_or_create can still cause IntegrityError

2011-05-07 Thread David Cramer
Would it help (in PG-world) at least if the selects where in savepoints as well? On May 7, 10:09 am, David Cramer wrote: > We hit this same issue in Postgres (it's definitely not MySQL > specific). I'm unsure of the solution or precise conditions we're > hitting it in, b

Re: Continued work on a django.contrib.formtools.wizard replacement

2011-05-11 Thread David Durham
On Mon, Apr 25, 2011 at 11:09 AM, Stephan Jäkel wrote: > Hi everybody, > > I want to continue the discussion on the replacement of > django.contrib.formtools.wizard (previous discussions can be found here: > http://bit.ly/eI5ZT5 and http://bit.ly/gVTRtr). I keep seeing some maintenance type of a

Re: Test optimizations (2-5x as fast)

2011-05-13 Thread David Cramer
You sir, are my personal hero for the day :) We had also been looking at how we could speed up the fixture loading (we were almost ready to go so far as to make one giant fixture that just loaded at the start of the test runner). This is awesome progress On May 13, 4:57 pm, Erik Rose wrote: > tl

Re: Test optimizations (2-5x as fast)

2011-05-13 Thread David Cramer
Also, one thing I'm quickly noticing (I'm a bit confused why its setup_class and not setUpClass as well), but this wont work with postgres without changing the DELETE code to work like the test runner's TRUNCATE foo, bar; (due to foreign key constraints). On May 13, 9:42 pm, Davi

Re: Test optimizations (2-5x as fast)

2011-05-13 Thread David Cramer
, you're still reliant that nothing was created with signals that uses constraints. For us this is very common, and I can't imagine we're an edge case there On May 13, 9:42 pm, David Cramer wrote: > You sir, are my personal hero for the day :) > > We had also been looking at h

Re: Test optimizations (2-5x as fast)

2011-05-16 Thread David Cramer
x27;t correspond to a fixture or a model in the same app. -- David Cramer http://justcramer.com On Mon, May 16, 2011 at 9:09 PM, Erik Rose wrote: > Woo, thanks for the constructive suggestions! > >> Also, one thing I'm quickly noticing (I'm a bit confused why its >>

Re: Test optimizations (2-5x as fast)

2011-05-17 Thread David Cramer
Is there a sensible to way "copy" databases in SQL? it's pretty obvious with things like sqlite, but outside of that seems tricky. I really like that idea, and you should definitely just be able to (at the very least) run a unique hash on the required fixtures to determine if a database is availabl

Re: Test optimizations (2-5x as fast)

2011-05-20 Thread David Cramer
Here's my proposal, assuming it can be done: 1. Create default database. 2. Run a test 3. If a test has fixtures, check for, and if not, copy base table to ``name_``. 4. Start transaction 5. Run Tests 6. Roll back I think that pretty much would solve all cases, and assuming you reuse tons of

Re: Django Error Display Page

2011-06-10 Thread David Cramer
class EasyWin(object): def process_exception(self, request, *args, **kwargs): if not request.is_ajax(): return impot traceback return HttpResponse(traceback.format_exc()) On Jun 10, 1:11 pm, Daniel Watkins wrote: > On Thu, Jun 09, 2011 at 08:31:44PM -0700, Valentin Golev wrote: > >

Re: ImportError catching in urlresolvers.py

2011-06-14 Thread David Cramer
This is currently a problem all over in the Django codebase, and I'd love to see a generic/reusable approach at solving this everywhere. On Jun 14, 1:19 pm, Michael Blume wrote: > In RegexURLPattern._get_callback, we attempt to fetch the callable named by > the URL pattern, and catch a possible I

Re: required=True for BooleanFields

2011-06-16 Thread David Cramer
I'm not suggesting changing the behavior (again due to the compatibility concerns), but I completely agree with the original poster(s). Also, in my experience it's a much less common case that you're wanting an "I agree" checkbox in your form, versus a "Boolean" field which can be positive or nega

[RFC] Moving from FormWizard to ViewWizard

2011-08-13 Thread David Danier
e try to move forward to a ViewWizard? Greetings, David For the curious, about the shortcomings I ran into: I tried to build a registration process including payment based on the FormWizard. This all worked fine until we needed to add more payment options. Many payment providers (Paypal, G

Re: [RFC] Moving from FormWizard to ViewWizard

2011-08-15 Thread David Danier
what happens and how the data is processes. The Step2View above could - for example - point to the next step if some link gets clicked. Correct me if I'm wrong about the new WizardView. David -- You received this message because you are subscribed to the Google Groups "Django devel

Re: [RFC] Moving from FormWizard to ViewWizard

2011-08-15 Thread David Danier
ll try to move this into a third party app. Currently I think I can reuse much of the code you and Stephan wrote to implement WizardView (for example the storage system), which is nice. David -- You received this message because you are subscribed to the Google Groups "Django developers&

Re: [RFC] Moving from FormWizard to ViewWizard

2011-08-15 Thread David Danier
what happens and how the data is processes. The Step2View above could - for example - point to the next step if some link gets clicked. Correct me if I'm wrong about the new WizardView. David -- You received this message because you are subscribed to the Google Groups "Django devel

initial_data and post_syncdb conflicts

2011-08-18 Thread David Cramer
We've been working on switching our test suite to use some new "super fixtures", which are really just global, test-only initial_data style fixtures. To implement this we attach to the post_syncdb, and set a runonce-per-db flag (since it seems to be the only available signal), but we hit some issue

Re: initial_data and post_syncdb conflicts

2011-08-19 Thread David Cramer
why > would the other fixtures rely on the initial_data? > > On Aug 18, 4:15 pm, David Cramer wrote: > > > > > > > > > We've been working on switching our test suite to use some new "super > > fixtures", which are really just global, test-only i

Re: help with Error was: No module named io

2011-08-29 Thread David Stanek
d not import %s. Error > > > was: %s" % (mod_name, str(e))) > > > > > Exception Type: ViewDoesNotExist at / > > > Exception Value: Could not import base.views. Error was: No module > > > named io > > > > > -- > > > Yo

Re: ticket 13125 is waiting for a design decision for 18 months

2011-09-02 Thread David Danier
s needs to be documented ("WARNING: ...") or changed in a backwards compatible way (e.g. add a parameter to login_required). David -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django

Multi-DB support within transaction middleware

2011-10-18 Thread David Winterbottom
is is sensible. -- *Dr. David Winterbottom* Head of Programming Tangent Labs 84-86 Great Portland Street London W1W 7NR England, UK -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to dj

Re: Ability to specify a skeleton project

2008-05-29 Thread David Reynolds
r your feedback, I'll have a stab at coding it. -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to djan

Introducing ModelView, a RESTful class-based view of your resources

2008-06-08 Thread David Larlet
* Ideas? I know that it needs tests and documentation but I'd like to bring the discussion here because I think it's important to have feedback before going too deep. So let me know if my secret goals above are crazy or if I need to spend more time on this. Cheers, David (aka david`b

Re: Introducing ModelView, a RESTful class-based view of your resources

2008-06-09 Thread David Larlet
Le 8 juin 08 à 16:11, Ivan Sagalaev a écrit : > > David Larlet wrote: >> This is not a secret that I'm interested in both Django and Semantic >> Web. I'm following discussion about Django+REST for more than two >> years and when I realize that newforms-adm

Re: Django releases

2008-06-10 Thread David Larlet
s-admin wasn't done in a fashion similar > to newforms Very good idea, the transition/merge will be easier if there is an alternative like that. David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

Dynamic Fields in Models

2008-06-12 Thread David Cramer
I came across the need today to modify PhoneNumberField to allow for International phone numbers. Doing so, it occurred to me, it'd be very useful just to be able to swap out my phone number field with the localized version based on whatever country was selected. Has any thought/real-use happened

Re: intcomma and locale

2008-06-12 Thread David Cramer
I received a nice lecture when I asked "why doesn't Jinja (a template engine I use as an alternative to Django) include an intcomma filter, its very useful" on the fact that intcomma is a [insert a bunch of negative remarks here] name for the filter, and it's an internationalization concept, not a

Re: Introducing ModelView, a RESTful class-based view of your resources

2008-06-12 Thread David Larlet
Le 9 juin 08 à 13:52, David Larlet a écrit : > > Le 8 juin 08 à 16:11, Ivan Sagalaev a écrit : >> >> David Larlet wrote: >>> This is not a secret that I'm interested in both Django and Semantic >>> Web. I'm following discussion about Django+REST

Re: One more issue with file storage

2008-06-12 Thread David Larlet
l work on the FTPStorage soon. Hope it helps, let me know if there are other storages in progress. Cheers, David --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this

Re: Multiple database support

2008-06-16 Thread David Cramer
I suppose I'll chime in here since we actually wrote master/slave replication code on Curse. Our approach: - read_cursor and write_cursor exist. write_cursor is what cursor would point ot. - get queries all use the read cursor - saves all use the write cursor - we had a list of database connecti

Re: Experimental Git repository available

2008-06-20 Thread David Reynolds
e top of my head remember how he did it. http://oebfare.com/blog/2008/jan/23/using-git-django-screencast/ -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django devel

Re: Introducing ModelView, a RESTful class-based view of your resources

2008-06-20 Thread David Larlet
Salut Clément, Le 19 juin 08 à 16:15, tifosi a écrit : > > Hi David, > > Thank for your code and the repository, I use the django-rest- > interface and > it's good news, that someone continue the job. > > I would like to get nested resources (e.g.: /articles/1/comme

Re: GSOC: More backends for djangosearch

2008-06-24 Thread David Reynolds
ould happen or just a combination of the two codebases, especially since they are at the end of the day aiming at the same goal. -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: URL Resolvers: a little refactoring goes a long way

2008-06-24 Thread David Larlet
Ken, It looks interesting but are there any examples of your urlresolver usage? David Le 24 juin 08 à 21:35, Ken Arnold a écrit : > > newforms-admin has a special-cased URL dispatcher in site.py. (see > #6470) > > Various REST-ish frameworks have a '.*' url mapp

Re: Call for testing: streaming uploads (#2070)

2008-06-27 Thread David Reynolds
www/django/git/django/tests/regressiontests/ string_lookup/models.py", line unknown line number, in API_TESTS -- File "/var/www/django/git/django/tests/regressiontests/string_lookup/ models.py", line ?, in regressiontests.string

Unify wraps() and update_wrapper() imports?

2008-06-28 Thread David Danier
quote, but this is somewhat different) Greetings, David Danier P.S.: I did not open a ticket on this, as I think, this needs discussion and such minor issues should not flood trac. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: XMLField in nfa

2008-07-01 Thread David Danier
4 for details. The second ticket contains a XML-validator using lxml. Greetings, David Danier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to dj

Re: Community representation, or, #django user "Magus-" needs to go far away

2008-07-01 Thread David Cramer
I'll agree Magus is harsh, but he's also helpful, and this isn't the place to discuss this :) On Jul 1, 11:40 am, "Rajeev J Sebastian" <[EMAIL PROTECTED]> wrote: > +1 to Tom, though magus > > On Tue, Jul 1, 2008 at 7:34 PM, Tom Tobin <[EMAIL PROTECTED]> wrote: > > On Tue, Jul 1, 2008 at 4:25 AM,

Re: newforms rendering and MVC pattern

2008-07-01 Thread David Cramer
I personally like the rendering methods being attached to the form, as they don't make sense as a universal template filter/tag. I do however, use a filter as "as_p" doesn't do much :) On Jun 28, 8:33 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-06-28 at 06:12 -0700, ionut wro

Re: Call for testing: streaming uploads (#2070)

2008-07-01 Thread David Cramer
I haven't read this over in too much detail yet (I just auto ignore the 10k trac emails about it :P) but a few concerns: - Is there a setting (e.g. settings.py) to restrict the maximum file size in an upload? - For test suites couldn't you while (xrange(n)) pass /dev/random or whatever to make a

Re: XMLField in nfa

2008-07-01 Thread David Danier
t posted some code that works here, but it doesn't fit into django in its current state. Greetings, David Danier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post

Some ideas about AUTH_PROFILE_MODULE (tickets: #7584, #7592 and #7400)

2008-07-02 Thread David Danier
ree new lines and should not cause any trouble I think. Of course docs are missing so far. Greetings, David Danier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to th

Re: Some ideas about AUTH_PROFILE_MODULE (tickets: #7584, #7592 and #7400)

2008-07-02 Thread David Danier
to mention. ;-) This doesn't remove the need to catch the DoesNotExist-exception everywhere. Additionally it does not work when trying to create reusable applications that need to have access to some profile. Greetings, David Danier --~--~-~--~~~---~--~

Re: One more issue with file storage

2008-07-10 Thread David Larlet
t; > There's also work being done on an S3 storage system that'll be dead > simple to drop in once my file work lands. I don't have a link for it > offhand; David, if you're listening, can you point the way to your > repo? It's gonna be some good stuff. Sure, the

Re: Make clickable area of object links larger

2008-07-13 Thread David Danier
the whole field clickable, every other field can be made clickable by configuration, if someone wants. I don't like the idea of making the whole row clickable. Greetings, David Danier --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Make clickable area of object links larger

2008-07-13 Thread David Danier
s, too. So making the whole field () clickable should really be enough, the row itself (everything inside ) does not need to be clickable by default. Greetings, David Danier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: MySQL BINARY WHERE Clauses

2008-07-21 Thread David Cramer
2, 2008 at 1:25 AM, Karen Tracey <[EMAIL PROTECTED]> wrote: > On Tue, Jul 22, 2008 at 2:13 AM, David Cramer <[EMAIL PROTECTED]> wrote: > >> >> I was using utf8_general. I'm swapping to utf8_bin to attempt to fix >> it, but binary encodings cause problems as w

Re: MySQL BINARY WHERE Clauses

2008-07-21 Thread David Cramer
Sorry, to be more clear, that is an *exact* match on what is in the database, but using the BINARY form does not return the result. On Tue, Jul 22, 2008 at 1:45 AM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Tue, 2008-07-22 at 01:29 -0500, David Cramer wrote: > [.

Ability to delete contents of FileField and ImageField in admin

2008-08-18 Thread David Reynolds
a FileField or ImageField from within the admin? Thanks, David -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, sen

Re: Ability to delete contents of FileField and ImageField in admin

2008-08-18 Thread David Reynolds
On 18 Aug 2008, at 2:56 pm, Brian Rosner wrote: > Keep an eye on http://code.djangoproject.com/ticket/7048. Thanks, Brian. -- David Reynolds [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

MySQL and Autocommit

2008-08-23 Thread David Cramer
Recently I noticed a bunch of queries I was executing by hand (one's which the ORM didn't support) were not being committed. I dug into the docs, and it clearly states that the default transaction mode is autocommit, and mysql's default transaction mode is autocommit. So, my question is, what's

Policy regarding security support for 0.96

2008-08-27 Thread David Spreen
time seems rather unlikely). Since Security is important to Debian, I wondered if there is a policy as to how long old stable releases (in this case 0.96) will receive security support. All my best, David Spreen P.S.: I do not speak on behalf of the Debian Project or the Debian Python Modules Team

Re: Composite Primary Keys

2008-08-27 Thread David Cramer
gn deicision to make on how that should be approached. On Wed, Aug 27, 2008 at 5:23 PM, Rock <[EMAIL PROTECTED]> wrote: > > Any progress on this patch David? I would be happy to take a look at > whatever you have and perhaps help out with completing the patch. > > > > --

Re: Composite Primary Keys

2008-08-27 Thread David Cramer
n Wed, Aug 27, 2008 at 6:15 PM, Alberto García Hierro <[EMAIL PROTECTED]>wrote: > > > El 28/08/2008, a las 0:27, David Cramer escribió: > > > Really I'm stuck at an architectural point. > > > > I have database validation and synchronization done, and the admi

Re: Composite Primary Keys

2008-08-28 Thread David Cramer
ple public fields. On Thu, Aug 28, 2008 at 5:36 PM, Rock <[EMAIL PROTECTED]> wrote: > > To be clear, the syntax is: > > myfkey = models.ForeignKey(SomeClass,to_field="id") > > > > > -- David Cramer Director of Technology iBegin http://www.ibegin.com/ --~-

Re: A (last-minute) compromise on {% url %}

2008-08-29 Thread David Larlet
e to use this var in blocktrans? {% url args as myurl %} {% blocktrans %} foo baz {% endblocktrans %} That's potentially the best solution for the endless discussion about urls in blocktrans. Best, David --~--~-~--~~~---~--~~ You received this messag

Re: primary_key for ImageField does not work any more

2008-09-02 Thread David Cramer
This sounds like a bug. I would submit a ticket for it. On Sep 1, 6:42 am, Jochen Voss <[EMAIL PROTECTED]> wrote: > Hello, > > with Django 0.96 I used a model which contained the following field: > >     class ImageFile(models.Model): >         [...] >         fname = models.ImageField(upload_to=

Re: Composite Primary Keys

2008-09-03 Thread David Cramer
owever full support for setting up and managing partitioned > models need not be included at this time. (I plan to help add that > later.) The interesting point is that support for related fields for > the Composite Primary Key is not required in order to support this > particular use

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread David Zhou
it, and we'll see you in a few days for DjangoCon. Congrats to the entire Django team! --- David Zhou [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group.

Re: Composite Primary Keys

2008-09-03 Thread David Cramer
9-02 at 22:02 -0700, David Cramer wrote: > > For anyone who's interested, it'd be great to meetup at DjangoCon to > > go over a good design approach to composite fields. > > Take notes. There's going to be a lot going on at DjangoCon (including > celebrating), so the

Re: Templates extending themselves cause infinite recursion

2008-09-04 Thread David Cramer
Does the error message pretty easily let you figure out what's wrong? On Aug 31, 1:38 pm, Martin Ostrovsky <[EMAIL PROTECTED]> wrote: > Now I'm not sure if this is a bug worth squashing or more a case of if > you're dumb, you deserve what you get but ... I erroneously extended a > template with i

Re: multi-column field support (#5929)

2008-09-10 Thread David Cramer
Ya, depending on how support is planned I may be able to remove some of the composite pk hacks. FYI the last patch I threw up didn't work in all areas, but I do have it running on our staging environment now without issues (so far). The code is only very slightly changed though. On Sep 9, 8:10 p

Re: I want a pony: Distributed RCS

2008-09-12 Thread David Zhou
> tone more mature than your average mailing list. :) > > You damn kids and your fancy "DVCS" tools. Emacs backups are the only > revision control I've ever needed! You mean *VIM* backups, don't you?!! --- David Zhou [EMAIL PROTECTED] --~--~-~--~~---

Re: Composite Fields

2008-09-16 Thread David Cramer
I think that will work Malcom. One thing we'll need to deal with, is .name, .attname, etc on these. It should act the same way on the pk as it does on the multi-column field (because after all, this will be just a wrapper). Right now .pks is just an alias for .pk.as_tuple or something. I had it th

Re: Denormalisation, magic, and is it really that useful?

2008-09-23 Thread David Cramer
If you're not doing denormalization in your database, most likely you're doing something wrong. I really like the approach that is offered here. For me, personally, it would be great if this could accept callables as well. So you could store the username, like so, or you could store a choices fie

Inner imports in core code

2008-09-24 Thread David Cramer
I was digging through some code today, and I noticed imports are happening within a lot of functions. It was my knowledge that it works like so: import in a function is the same as ruby's load or php's include -- its executed everytime the function is import in a module outside a function is lik

Re: Denormalisation, magic, and is it really that useful?

2008-09-24 Thread David Cramer
ying DB platform won't support > triggers, but wouldn't triggers be the preferred solution when they're > available? That way there is no chance that changes can be made outside > the scope of the denormalization, and hence no need to recompute the > denormalized values. >

Re: Denormalisation, magic, and is it really that useful?

2008-09-24 Thread David Cramer
s executing the subquery in sql to get the denormalized output). On Sep 23, 4:19 pm, "Justin Fagnani" <[EMAIL PROTECTED]> wrote: > On Tue, Sep 23, 2008 at 12:52 AM, David Cramer <[EMAIL PROTECTED]> wrote:> > > For me, personally, it would be great if this could acc

Re: Optimizations on templates

2008-09-25 Thread David Cramer
Just use Jinja if you want faster template rendering ;) In all seriousness though, this sounds like an awesome optimization which I think should be fair game for 1.1. On Sep 24, 6:28 pm, Johannes Dollinger <[EMAIL PROTECTED]> wrote: > Am 25.09.2008 um 00:39 schrieb Manuel Saelices: > > > > > It'

Re: Denormalisation, magic, and is it really that useful?

2008-09-25 Thread David Cramer
CopiedField sounds a bit off, but otherwise I like the proposed additions. On Thu, Sep 25, 2008 at 8:08 AM, Andrew Godwin <[EMAIL PROTECTED]>wrote: > > David Cramer wrote: > > I would say ignore triggers on the DB level, until they've been > > written in the fra

Sitemaps Memory Usage

2008-09-28 Thread David Cramer
We launched the new iBegin.com yesterday, and congrats to Django we've pushed over 600 req/s on a server shared with several other websites and daemons (including sphinx and memcached). BUT I noticed a huge issue right after launch with memory usage. It was randomly spiking (and staying) high. Th

Re: Sitemaps Memory Usage

2008-09-28 Thread David Cramer
Also in regards to this, using a template is overkill in my opinion. Especially if it's going to cause extra headaches. I'll try out your recommendation for now, thanks Malcolm. On Sep 28, 11:40 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-09-28 at 21:21

ManyToManyField with raw_id_admin

2008-09-29 Thread David Cramer
After miserably failing at making it possible to use a field with 10k choices, I've decided to take a new approach in the admin. Right now I'm writing up a widget which would take the m2m field (for raw_admin_fields) and output it just as it would a foreign key, except one input per line. This

Re: ManyToManyField with raw_id_admin

2008-09-29 Thread David Cramer
It seems I was unbelievably blind and not seeing the spyglass icon on M2M fields. Please ignore me :) On Sep 29, 5:48 pm, David Cramer <[EMAIL PROTECTED]> wrote: > After miserably failing at making it possible to use a field > with 10k choices, I've decided to take a new appr

Query Cleanup in Admin History Log

2008-09-30 Thread David Cramer
It seems theres some issues, and this may go outside of the scope of the admin history log (I didn't dig into the code). 1) It looks like it could use a .select_related('content_type') as it's doing a query for every content type, repeatedly even. 2) It's adding an ORDER BY on the .get()-like qu

Re: Query Cleanup in Admin History Log

2008-09-30 Thread David Cramer
Oh, and it's also selecting the user in that history log query and not using it.. at least from the looks of it. On Sep 30, 5:23 am, David Cramer <[EMAIL PROTECTED]> wrote: > It seems theres some issues, and this may go outside of the scope of > the admin history log (I didn&#x

Re: Query Cleanup in Admin History Log

2008-09-30 Thread David Cramer
At least part of it seems to be fixed here: http://code.djangoproject.com/attachment/ticket/9083/getAdminLogRelated.patch On Sep 30, 5:24 am, David Cramer <[EMAIL PROTECTED]> wrote: > Oh, and it's also selecting the user in that history log query and not > using it.. at least

HttpResponse and file-like objects

2008-09-30 Thread David Cramer
I'm running into an issue when trying to pass a file-like object to HttpResponse and telling it to label it as "application/xml" def sitemap(request, sitemaps, section): page = request.GET.get('p', 1) fpath = os.path.join(settings.BASE_PATH + '/', 'cache/sitemap-%s- %s.xml' % (section, pa

Re: HttpResponse and file-like objects

2008-09-30 Thread David Cramer
Thanks Graham, I'll check that out. I was going to file a ticket for this, but it seems streaming isn't really "supported" anyways, so I had to change the approach. On Sep 30, 8:19 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Oct 1, 11:06 am, David Cra

Re: unique_for_ fields

2008-10-01 Thread David Danier
s Meta: # perhaps useful for urls like /foo unique_together = ('slug', 'category', 'pub_date__year') Just some ideas I had when reading the original post, don't know if this would require lots of work. :) Greetings, David Danier --~--~-

Django model version control

2008-10-01 Thread David Hall
I've just released an open-source version control application for Django. It is available for download from Google code. http://code.google.com/p/django-reversion/ Features include: - Roll back to any point in a model's history - an unlimited undo facility! - Recover deleted models - never

Re: Composite Primary Keys

2008-10-04 Thread David Cramer
ey or with composite pk. It provides 2 > methods: > > - use of oid field (works on sqlite, oracle, postgres <= 8) > - composite pk (for mysql that provides no oid field) > > cheers, > Eric > > > -- David Cramer Director of Technology iBegin http://www.ibegin.com/

Re: Proposal: Improvements for django.forms

2008-10-18 Thread David Cramer
Some of these changes I think are very valuable, especially CSS classes. The formfield_kwargs I don't think is the right approach, but possibly a method which could be called, as a lot of times I'm overriding __init__ and it's quite messy, just to change the queryset for a form. I would personall

Re: Proposal: AnonymousUser that you can set specific permissions for

2008-10-25 Thread David Cramer
I think being able to specify permissions for the AnonymousUser is useful, but hacking this in as a row in the database for User is not the right approach. I'm +1 for the ability to give permissions to anonymous users. On Oct 24, 9:59 pm, "Dj Gilcrease" <[EMAIL PROTECTED]> wrote: > On Fri, Oct 2

Re: Proposal: AnonymousUser that you can set specific permissions for

2008-10-26 Thread David Cramer
have permissions set to it. On Oct 25, 10:46 am, "Dj Gilcrease" <[EMAIL PROTECTED]> wrote: > On Sat, Oct 25, 2008 at 2:59 AM, David Cramer <[EMAIL PROTECTED]> wrote: > > > I think being able to specify permissions for the AnonymousUser is > > useful, but hack

Re: Alternate ForeignKey based on choices

2008-10-27 Thread David Cramer
What you're wanting is a GenericForeignKey. Check out the django.contrib.contenttypes documentation. On Oct 26, 9:48 am, "Calvin Spealman" <[EMAIL PROTECTED]> wrote: > You could also have a common parent class for Robot and User, and use that > as your foreign key type. Which type is referenced w

Re: Composite Primary Keys

2008-10-30 Thread David Cramer
Oct 30, 2008 at 3:40 PM, Joey Wilhelm <[EMAIL PROTECTED]> wrote: > > David, > > What is the current status of this patch? I'm starting up a new > project which pretty much desperately needs this support as well. I > could work around it, but the thought of adding AutoFie

Re: Composite Primary Keys

2008-10-30 Thread David Cramer
eral proposals earlier along on this thread, but > obviously nothing solid. Did anything ever come from DjangoCon on this > topic? What issues still need to be addressed in this design? > > On Thu, Oct 30, 2008 at 13:46, David Cramer <[EMAIL PROTECTED]> wrote: > >> It allo

Re: Cache and GET parameters

2008-11-02 Thread David Cramer
I really like the idea of the explicit GET params passed.So I'm +1 especially on solution #3. I actually had never realized it wasn't caching pages with GET params, luckily though, any pages where I use this decorator don't fluctuate like that :) On Nov 1, 7:51 pm, "Jeremy Dunck" <[EMAIL PROTECTE

select_related optimization and enhancement for the django.contrib.admin

2008-11-10 Thread David Cramer
While I've been working on composite primary keys, I also made a few tweaks to the admin app. Most of these are related to the primary key support, but one is an optimization. I would post this as a patch, or a ticket, but I want to open this up for discussion, and my django repo is so far from t

order_by_fields for django.contrib.admin

2008-11-10 Thread David Cramer
One of the last of my feature-needs (for optimization reasons) is the ability to specify what fields can, or can't be ordered in the admin apps. I'd like to propose something along the lines of: order_by_fields = ('field', 'field', 'field') This would allow you to only order by fields which

Re: Denormalisation Magic, Round Two

2008-11-10 Thread David Cramer
I'm not sure on AggreateField either. What if you just do like ("Photo", "user__exact=self.user") or something. Currently there's no rerepsentation for "self" in Django QuerySet's, so this is a hard thing to call. Also, we need a way to support callables. e.g. models.MirrorField("my_callable_or_a

Re: Proposal: Make filters in admin persistent (#6903)

2008-11-11 Thread David Cramer
Before this gets accepted, I'd like to throw in the proposal of storing this in the session vs a huge URL. That and a hash seem to be the common approach to storing search paths. On Nov 11, 7:19 am, Jonas Pfeil <[EMAIL PROTECTED]> wrote: > Currently if you search in the admin, use some kind of fi

Re: Proposal: Make filters in admin persistent (#6903)

2008-11-11 Thread David Cramer
the URL.  Naturally if   > you do it this way, you'd also want to have a visible "clear filters"   > link so that there's some way to reset that state, I didn't check the   > patch to see if this was already included. > > On Nov 11, 2008, at 4:35 PM, David Cr

Re: select_related optimization and enhancement for the django.contrib.admin

2008-11-11 Thread David Cramer
e a boolean, or a list. This, in my eyes, is fully backwards compatible, as its only an addition to the public API, and a bug fix. On Tue, Nov 11, 2008 at 3:17 AM, Malcolm Tredinnick < [EMAIL PROTECTED]> wrote: > > > On Mon, 2008-11-10 at 17:13 -0800, David Cramer wrote: >

Re: Proposal: Make filters in admin persistent (#6903)

2008-11-11 Thread David Cramer
hat functionality,   > I would ask for something to be added to the admin that would print   > out a URL that you could give to another user to get the filtering you   > were just using.  Which sounds handy, but is a separate ticket from   > what we're discussing here. > > On

Re: Proposal: Make filters in admin persistent (#6903)

2008-11-11 Thread David Cramer
;d really want to save all three,   > because they all go together insofar as returning you to *exactly* the   > view you were last using.  If you're going to preserve it at all,   > might as well do it right and preserve it as pristinely as possible. > > On Nov 11, 2008, at 5:3

Re: Proposal: Ordering in the admin and via the model API

2008-11-12 Thread David Cramer
Ya this is much more needed for me on ForeignKey's, but that's like adding magical models (which I like!). You'd have to add left order, and right order fields, on the model referenced in the ForeignKey, to have an OrderedForeignKey field. This, without migrations, would not be fun with DB mainte

Proposal: Composite Foreign Keys

2008-11-13 Thread David Cramer
Here's my proposal for the composite keys (which act much like generic keys except more useful): class MyModel2: pass class MyModel3: pk_part1 = models.AutoField() pk_part2 = models.ForeignKey(MyModel2) name = models.TextField() class MyModel: pk_part1 = models.IntegerField(

<    1   2   3   4   5   6   7   8   9   >