set_urlconf/get_urlconf patch

2009-09-22 Thread Sean Brant
I have updated the patch on this ticket (http://code.djangoproject.com/ ticket/5034) that SmileyChris wrote a while back. I ensured that the new patch works against rev:11590. In talking to SmileyChris about this on the IRC channels he noticed that not clearing the _urlconfs dict after each reque

Re: Proposal: Tutorial Refresh

2009-10-09 Thread Sean Brant
+1 Simon's idea of a conference site. Adding some features like http://hello.carsonified.com/ would be cool to have, though it might be to advance for this kind of tutorial. Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: shortcut proposal

2009-10-16 Thread Sean Brant
Using a decorator allows you to do cool things like @provides_html('myapp/mypage.html') @provides_json(optional_serialize_callback_can_go_here) def my_view(request): return {'foo': 'bar') Then your provides_* could check the accept-header and know how to response. Html renders a template and

Re: shortcut proposal

2009-10-16 Thread Sean Brant
> I agree with Russ that why I hinted this might be better left for domain code. In my decorator I do check for an instance of HttpResponse and pass that thru unchanged. So of you want to return a HttpResponseRedirect inside if a if statment it will still work. My only problem is the boile

Re: CSRF changes - backwards incompatible

2009-10-27 Thread Sean Brant
Interesting note. A co-worker of my has been working with the poll tutorial for a couple days now and just got to part 3 which now contains the {% csrf_token %} tag. He could not figure out how why he was getting an error that the csrf_token tag could not be loaded. I'm not sure how wide spread t

Re: Regularly-scheduled Django sprints, first December 11 - 13

2009-11-10 Thread Sean Brant
Alex, I can help you out in Chicago if you need it. Sean --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscr

Re: Regularly-scheduled Django sprints, first December 11 - 13

2009-11-10 Thread Sean Brant
> Sure that'd be great, I guess we don't really need to start planning > until it gets a little closer, but if we want to have any discussions > about the local things let's try to revive the django-chicago mailing > list :) > > Alex Yeah, I agree. If you need admin access to that list I think To

template or is it template_name

2009-11-10 Thread Sean Brant
Stop me if you have heard this one before. Anyone else find it annoying that direct_to_template takes the kwarg "template" and most other generic views take "template_name". Smells a little like php to me. Is this something that should be / can be fixed? Sean --~--~-~--~~---

Re: Django needs for normal sequence of handlers for request processing

2009-11-25 Thread Sean Brant
Not sure if this would solve the problem, but have a look at django.utils.ddecorators.decorator_from_middleware. """ Given a middleware class (not an instance), returns a view decorator. This lets you use middleware functionality on a per-view basis. """ This also might be best discussed on djang

Re: Django needs for normal sequence of handlers for request processing

2009-11-25 Thread Sean Brant
Oh, forgot there are also signals that might help. http://docs.djangoproject.com/en/dev/ref/signals/#module-django.core.signals :) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googl

Re: Running unit tests when you can't create a new database

2009-12-09 Thread Sean Brant
This might help you out http://ericholscher.com/projects/django-test-utils/keep_database_runner.html. Or at least give you some pointers. - Sean On Wed, Dec 9, 2009 at 2:16 PM, Martin Omander wrote: > Russ, > > The method you describe sounds like the preferred way. It's cleaner to > add a new te

Possible bug with multi-db changes

2009-12-26 Thread Sean Brant
I just upgraded to the latest trunk today and the admin now throws an exception http://dpaste.com/138130/ when I try and save to a ImageField. I messed with it a bit to make sure that it was not something else in my code that could be causing the error. It looks like the error only occurs when I ha

Re: Possible bug with multi-db changes

2009-12-27 Thread Sean Brant
> Thanks for the report. I'll try and take a look at this today and work > out what is going on. In the meantime - if you could open this as a > ticket, I'd be much obliged. Russ I created a ticket for you http://code.djangoproject.com/ticket/12453. Thanks for looking into this. - Sean -- You

Re: Ticket #5025 - truncate filter, why hasn't it been accepted?

2009-12-30 Thread Sean Brant
On Dec 30, 2009, at 6:06 AM, Russell Keith-Magee wrote: > Firstly, as James points out, slice already exists, and the ellipsis > difference between slice and truncate can be easily overcome with > additional code. In the past I have had the need for a filter that works not just on the end of the

Re: Ticket #5025 - truncate filter, why hasn't it been accepted?

2009-12-30 Thread Sean Brant
The last thing that needs to happen is bulling this into core. It's no good for the community and that could be part of the perceived perceptions problem. Just because enough people bitch does not mean that its a good thing. With that said the reason behind the ticket being closed no longer seems v

django.contrib.messages failing silently in safari when comma is used in message

2009-12-30 Thread Sean Brant
If you try and send a message with new messaging app that contains a comma in the message it does not work in Safari. I'm not really sure why the json encoded message is not working in the Safari browser, but I fixed it by adding a base64 encode and decode step that encodes/decodes the message str

Re: django.contrib.messages failing silently in safari when comma is used in message

2009-12-30 Thread Sean Brant
Sorry should note, this happens when using the CookieStorage backend. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to dj

Re: django.contrib.messages failing silently in safari when comma is used in message

2009-12-30 Thread Sean Brant
I created a ticket for this http://code.djangoproject.com/ticket/12470 in case someone wants it. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from th

Re: Possible bug in messages framework?

2010-01-21 Thread Sean Brant
I wonder if this is related? http://groups.google.com/group/django-developers/browse_thread/thread/5613e9a03d92c902/738a3b81e405dc78#738a3b81e405dc78 On Jan 21, 2010, at 10:55 PM, j...@jeffcroft.com wrote: > After a little more playing around, I've discovered that this is not > an issue if I use

Re: Possible bug in messages framework?

2010-01-22 Thread Sean Brant
On Jan 22, 2010, at 7:04 PM, Luke Plant wrote: > Well, it depends on what you call the 'spec'. What spec says that > commas in values is invalid? > > The 'spec' linked to on that WebKit bug is a preliminary Netscape > document, which, as far as I can tell, eventually turned into RFC > 2109,

logialogin_required does not check User.is_active

2010-03-16 Thread Sean Brant
A co-worker of mine noticed this bug today http://code.djangoproject.com/ticket/13125. Should it be marked for 1.2 or punt it until after the release candidate? It looks to be a bug so it could probably go in at anytime. Let me know your thoughts. -- You received this message because you are sub

Re: start using less (and bootstrap!)

2012-02-02 Thread Sean Brant
On Thu, Feb 2, 2012 at 2:36 PM, Adrian Holovaty wrote: > On Thu, Feb 2, 2012 at 2:07 PM, Idan Gazit wrote: >> * less.js has the distinct advantage of being easier to develop for than >> sass for our purposes.If we go with a less.js solution (like bootstrap), we >> might not need to require that a

Re: start using less (and bootstrap!)

2012-02-02 Thread Sean Brant
On Thu, Feb 2, 2012 at 4:17 PM, Alex Gaynor wrote: > > > On Thu, Feb 2, 2012 at 5:01 PM, Adrian Holovaty wrote: >> >> On Thu, Feb 2, 2012 at 2:49 PM, Sean Brant wrote: >> > Is this up somewhere public? I've been fighting the urge to do this as >> >

Re: Proposal: upgrading the choices machinery for Django

2012-04-04 Thread Sean Brant
I agree we don't really gain anything from including this in core. Django model utils[1] has a pretty solid implementation of a choice abstraction. [1] https://github.com/carljm/django-model-utils On Wed, Apr 4, 2012 at 11:41 AM, Adrian Holovaty wrote: > 2012/4/3 Łukasz Langa : >> Explicit choic

Re: Provide a way to pass kwargs when initializing the storage class

2015-11-07 Thread Sean Brant
+1 to these ideas. This will make injecting dependancies much cleaner. I’ve pointed my BACKEND settings to factory functions in the past. def storage_factory(): return SomeStorage(some_de) DEFAULT_STORAGE_BACKEND = ‘path.to.storage_factory' > On Nov 7, 2015, at 7:10 AM, Shai

variable view name in url tag

2010-10-03 Thread Sean Brant
I know this has come up over the last few years[1] and people are mixed on the action that should be taken. I would like to bring it up again as it has bitten me a few time lately. I seems the biggest concern is backwards compatibility of the syntax. I feel that should not stop us from fixing some

Re: variable view name in url tag

2010-10-03 Thread Sean Brant
On Oct 3, 2010, at 7:37 PM, Russell Keith-Magee wrote: > On Mon, Oct 4, 2010 at 4:53 AM, Sean Brant wrote: >> I know this has come up over the last few years[1] and people are >> mixed on the action that should be taken. I would like to bring it up >> again as it has bitten

Re: variable view name in url tag

2010-10-04 Thread Sean Brant
On Oct 3, 8:08 pm, Russell Keith-Magee wrote: > On Mon, Oct 4, 2010 at 8:56 AM, Sean Brant wrote: > > > On Oct 3, 2010, at 7:37 PM, Russell Keith-Magee wrote: > > >> On Mon, Oct 4, 2010 at 4:53 AM, Sean Brant wrote: > >>> I know this has come up over

generic view fail fast

2010-10-20 Thread Sean Brant
One benefit with function based views that is lost with generic views is bailing (returning early) conditionally. Say you have a view returns its response if a condition is meet otherwise does some more possible expensive stuff and then returns. Its nice to bail and avoid the expensive stuff. Im n

Re: Bump/question for #13956

2010-11-03 Thread Sean Brant
Has supporting kwargs along with args been mentioned? I would find having both very helpful. Maybe we can lean on the work happening for the include and with tags. On Wed, Nov 3, 2010 at 10:06 AM, Stephen Burrows wrote: > As far as I know, the only thing still missing from the ticket is a > deci

Re: Changing settings per test

2010-11-04 Thread Sean Brant
On Nov 4, 4:26 pm, Alex Gaynor wrote: > 2010/11/4 Łukasz Rekucki : > > > > > > > Funny, I had exactly the same problem today at work while refactoring > > my application's tests suite :). > > > Currently, I'm using a pair of save/restore functions: save() monkey > > patches the settings module a

Re: Migrating to class-based views and django.core.urlresolvers.reverse

2010-12-07 Thread Sean Brant
Again this topic is now in django-user land. I do this in views.py if want the decorator on all methods (get|post). myview = login_required(MyView.as_view()) On Dec 7, 2010, at 1:10 PM, Daniel Swarbrick wrote: > That is indeed in the docs, and I have seen that. What eludes me is > how to us

r15580 breaks change list result template overwrites

2011-02-19 Thread Sean Brant
Looks like r15580 modified the way change list rows are returned. The template used to just iterate over {{ result }} but now requires iteration over {{ result.row }}. This will breaking anyones templates that happen to overwrite admin/change_list_results.html. Does overwriting admin templates fal

Caching model choice fields in admin inlines.

2011-05-23 Thread Sean Brant
If you have ever used a inline in the admin for a model that contained a model choice field you have probably noticed it has to query the database for each row to fill the select drop-down. This results in n+ identical queries. I though it might be useful to have a way to tell a admin inline to ca

Re: jQuery.tmpl() and Django

2011-05-27 Thread Sean Brant
2011/5/27 Gábor Farkas : > On Fri, May 27, 2011 at 7:04 AM, Sean O'Connor wrote: >> A better approach would for Django to provide some tools and documentation >> to help people work around the conflict.  One easy solution would be to >> provide a verbatim tag like what ericflo wrote >> at https://

Re: Automatic prefetching in querysets

2017-08-15 Thread Sean Brant
I wonder if a solution similar to [1] from the rails world would satisfy this request. Rather then doing anything 'magical' we instead log when we detect things like accessing a related model that has not been pre-fetched. [1] https://github.com/flyerhzm/bullet On Tue, Aug 15, 2017 at 5:14 PM, Lu

Re: PostGres 9.5 Upsert

2016-01-10 Thread Sean Brant
> On Jan 10, 2016, at 2:09 AM, Anssi Kääriäinen wrote: > > If I recall correctly, MySQL doesn't offer a way to specify on which index > you want to do the conflict resolution. This leads to problems - the upsert > might affect the wrong row if there are multiple unique indexes on the table. >

Re: Feedback on Django Channels

2016-03-21 Thread Sean Brant
How does the new channels model handle requests with sensitive information? Say you have a login view and the user is submitting a username/password. Does the password get serialized into the message queue as plain text? If so is that a security concern users should be aware of? Sean On Mon, Mar

Re: Making Django more PaaS-friendly

2016-04-11 Thread Sean Brant
https://github.com/joke2k/django-environ has helpers for loading most of the backends from urls. We use it with a docker based deployment at the moment. On Mon, Apr 11, 2016 at 8:46 AM, Ryan Hiebert wrote: > I'd love to see better support for PaaS configuration, especially > 12-factor. We use He

CITextField base class

2017-02-07 Thread Sean Brant
I noticed the new postgres citext[1] field is a subclass of CharField. Wouldn't it be more correct to subclass TextField? Subclassing CharField means we need to add a max_length which is ignored in the db. [1] https://github.com/django/django/blob/master/django/contrib/postgres/fields/citext.py

Re: CITextField base class

2017-02-08 Thread Sean Brant
>>> >>> >>> On Wednesday, February 8, 2017 at 11:32:22 AM UTC+1, Adam Johnson wrote: >>>> >>>> Sounds legit, make a ticket >>>> >>> >>> Shouldn't https://code.djangoproject.com/ticket/26610 just be reopened? >>

Re: CITextField base class

2017-02-08 Thread Sean Brant
On 8 February 2017 at 11:00, Mads Jensen wrote: >>> >>>> >>>> >>>> On Wednesday, February 8, 2017 at 11:32:22 AM UTC+1, Adam Johnson wrote: >>>>> >>>>> Sounds legit, make a ticket >>>>> >>>> >>&