New CharField attribute to handle CharField(null=True, blank=True, unique=True) in model forms

2016-05-18 Thread Jon Dufresne
Hi, Occasionally I'll need to define a CharField on a model that is unique but also allow blank values. At the database level, this is easily handled by storing NULL for the blank values. (Storing the empty string multiple times will result in a DB unique constraint violation.) This use case has

Re: ***SPAM*** Re: Middleware+Transactions:

2016-05-18 Thread charettes
As MIDDLEWARE supports decorator-like objects you could simply add `django.db.transaction.atomic' to it and you'd get each request wrapped in a transaction. Note that this will only start a transaction on the `default` database, just like the old TransactionMiddleware use to do. Simon Le

Re: ***SPAM*** Re: Middleware+Transactions:

2016-05-18 Thread Florian Apolloner
Starting with Django 1.10 you can write a TransactionMiddleware again, and we will probably ship one again. On Tuesday, May 10, 2016 at 2:07:30 AM UTC+2, Kevin Tran wrote: > > Thomas, did you ever find a solution to your problem? I'm having similar > thoughts and am looking for an answer. > >

Re: Oracle backend and passing data as is.

2016-05-18 Thread Jani Tiainen
Hm. I was able to figure out what it was and do have hack around that. OracleParam class does certain checks, mainly it chekcs if param is date/time/timedelta or true/false. Otherwise it converts everything to string. And that's where backend thinks that WKTAdapter coming from Oracle GIS

Re: Oracle backend and passing data as is.

2016-05-18 Thread Aymeric Augustin
Yes, we have a lot of code in this area. It isn’t particularly complex, but it isn’t always easy to tell what problem a particular line of code solves either. I’m afraid “educated guesses” are your best option at this point. Conditionally skipping some type conversions on sufficiently modern

Re: ***SPAM*** Re: Middleware+Transactions:

2016-05-18 Thread guettli
Am Dienstag, 10. Mai 2016 02:07:30 UTC+2 schrieb Kevin Tran: > > Thomas, did you ever find a solution to your problem? I'm having similar > thoughts and am looking for an answer. > > Carl Meyer has worked out an enhancement proposal, here is the pull-request:

Re: Template-based widget rendering

2016-05-18 Thread Carl Meyer
On 05/17/2016 01:33 AM, Claude Paroz wrote: > I can imagine that django.forms would then be responsible to tell the > template engine to add the template source. Maybe this would need a new > API in the template code? Yes, it's certainly possible that we could address this with a new API in the

Re: Template-based widget rendering

2016-05-18 Thread Carl Meyer
Hi Simon, On 05/17/2016 07:28 AM, charettes wrote: > Did we consider defining a template loader that knows where to load the > widget > templates from instead of requiring 'django.forms' in INSTALLED_APPS with > 'APP_DIRS': True in TEMPLATES? > > Something along theese lines make more sense to