Filtering on Many2Many Related Objects

2011-05-20 Thread Daniel Watkins
Hello all, Earlier I was trying to filter for objects that had a set of other objects related to them by a ManyToManyField. It's a bit awkward, and I have a couple of proposals to improve it. Consider the following models: class Person(models.Model): name =

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

Re: RFC: #12417 - Support for signing (including secure cookies)

2011-05-20 Thread Paul McMillan
> int(time.time()) == 1305761382 > base62.encode(1305761382) == '1QMqBS' > base62.encode(1305761382) == 'KgwVC' Oops! meant to say base62.encode(305761382) == 'KgwVC' -Paul -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this

Re: RFC: #12417 - Support for signing (including secure cookies)

2011-05-20 Thread Paul McMillan
>> Baseconv is a clever bit of work. It should probably be using our full >> base64 charset. We could also shave some digits in the time-limited >> output there by subtracting from a more recent fixed value than the >> unix epoch, the way the password reset token code does. > > The TimeStampSigner

Re: templates block prepend and append

2011-05-20 Thread Mateusz Harasymczuk
This should solve my problems, therefore my question is no longer valid. I missed that in the documentation. Probably I should ask at django-users first. Although {% extends "admin/index.html" after "blockname" %} would be a nice shorthand. or {% from "admin/index.html" import "blockname"

Re: templates block prepend and append

2011-05-20 Thread Luke Plant
On 20/05/11 17:14, Mateusz Harasymczuk wrote: > I have recently fought with extending templates. > Plenty of my usecases are almost the same: append some html before or > after admin templates blocks. {{ block.super }} sounds like what you want. If not, please let us know why. Regards, Luke --

Re: Reshaping the "Contributing to Django" documentation

2011-05-20 Thread Jonas H.
"[...] try and duplicate it. If you can duplicate it [...]" I'd stick with "reproduce" here because "duplicate" may be confused with "duplicate tickets". -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email

templates block prepend and append

2011-05-20 Thread Mateusz Harasymczuk
I have recently fought with extending templates. Plenty of my usecases are almost the same: append some html before or after admin templates blocks. To do so, I have to take template, copy the contents and save modified file as a html in my templates dir. What happens if django contrib.admin

Re: Reshaping the "Contributing to Django" documentation

2011-05-20 Thread Waylan Limberg
On Fri, May 20, 2011 at 5:31 AM, Julien Phalip wrote: > Hi there, > > I've been working on reshaping the documentation about contributing to > Django, in particular the rather dense historical page [1] and the > excellent recently added how-to guide [2]. This documentation has

Re: list_display does not allow foreign keys __ syntax

2011-05-20 Thread Anshuman Aggarwal
Usage would be: list_display = (ff('model__field__fkfield', short_description='FK Field') but ideally, the short_description should be optional with the default logic being used to fetch it out of the FK. We can change the __ to a . easily enough without any impact to anything else. On May 20,

Re: list_display does not allow foreign keys __ syntax

2011-05-20 Thread Anshuman Aggarwal
Hi Luke, Thanks for a detailed reply. I have gone over your points carefully and agree on most except a few key ones. Based on your response: - The question here is really how often is the guesswork right and for how many different projects/use cases. I have overseen Django used at more than a

Reshaping the "Contributing to Django" documentation

2011-05-20 Thread Julien Phalip
Hi there, I've been working on reshaping the documentation about contributing to Django, in particular the rather dense historical page [1] and the excellent recently added how-to guide [2]. This documentation has sort of grown organically over the years and has become a bit difficult to read, so