FileField binary/text mode

2014-08-23 Thread Martin Tiršel
Hello, today, I wanted to use FileField directly in Python CSV module, but problem was, that CSV module requires the file to be opened in text mode, not binary. So I though that this will be sufficient: obj.my_file_field.file.close() obj.my_file_field.file.open(mode='r') csvreader =

admin_order_field on __unicode__ method does not enables sorting

2014-05-24 Thread Martin Tiršel
Hello, is any reason why this does not work or is it just a bug? # models.py class ContainerProfile(models.Model): name = models.CharField() # ... def __unicode__(self): return self.name __unicode__.admin_order_field = 'name' # admin.py @admin.register(ContainerProfile

Field.get_default() returning dict instance causing migration to fail

2014-05-05 Thread Martin Tiršel
Hello, I just installed 1.7 (pip install git+https://github.com/django/django@stable/1.7.x) and the django-jsonfield app. As you can see here, JSONField.get_default() returns a dict instance, not a string: https://bitbucket.org/schinckel/django-jsonfield/src/28c51eb06a65c1e7b5d8022031aebb034e0

Weird characters in HTTP_USER_AGENT

2012-11-01 Thread Martin Tiršel
Hi all, some days ago I began to store user agent strings but found, that there is at least one client with some weird characters causing the SQL query to fail. In the txt logs I have: `Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; IS<8a> Sokolnice; IS<8a> Sokolnice)` this is my code in

Re: FormMixin success_url should accept callable

2012-04-09 Thread Martin Tiršel
ation until after the urlconf has been initialised. I don't think there's a real benefit to having a third approach. Regards, Andrew Ingram On 8 Apr 2012, at 22:12, Martin Tiršel wrote: Hello, I just started to use class based views and I came to the CreateView and success_url

FormMixin success_url should accept callable

2012-04-08 Thread Martin Tiršel
Hello, I just started to use class based views and I came to the CreateView and success_url argument. This argument has to be string what leads to typing URLs in views instead of using reverse() function (you have no access to urls through reverese() in view initialization). I think (if the