Version 0.3.3

60 views
Skip to first unread message

Tom Christie

unread,
Feb 20, 2012, 3:38:24 PM2/20/12
to django-res...@googlegroups.com
Pushed 0.3.3, which cleans up a bunch of stuff around using staticfiles and templates properly, is updated for URLObject 2.0.0, and adds the much needed DjangoModelPermissions.

Be aware that unnamed args in the URLconf no longer  magically get treated as the pk.  All args must be explicit.

Please let me know if anyone sees any problems with the release.

* Added DjangoModelPermissions class to support django.contrib.auth style permissions.
* Use staticfiles for css files. - Easier to override. Won't conflict with customised admin styles (eg grappelli)
* Templates are now nicely namespaced. - Allows easier overriding.
* Drop implied 'pk' filter if last arg in urlconf is unnamed. - Too magical. Explict is better than implicit.
* Saner template variable autoescaping.
* Tider setup.py
* Updated for URLObject 2.0
* Bugfixes: - Bug with PerUserThrottling when user contains unicode chars. 

poswald

unread,
Feb 21, 2012, 10:31:33 PM2/21/12
to django-rest-framework
Worth noting.. if you use virtualenv with distribute, you may have to
upgrade your env due to the way that URLObject 2.0 is packaged. I got
an error telling me I need distribute >= 0.6.24. See also:

https://github.com/zacharyvoase/urlobject/commit/654f4e35cb81b6bcfed058069a1890d929d2e21c

smcoll

unread,
Feb 26, 2012, 4:51:11 PM2/26/12
to django-rest-framework
This thread helped me out.  the with_query_param tag was adding a
trailing slash to all the URLs.  It had to do with URLObject behavior.
 i updated to URLObject 2.0 and now it's working fine.

Here's what it was doing:

```
>>> from urlobject import URLObject
>>> url = '/foo'
>>> URLObject(url).with_query('bar=baz')
<URLObject(u'/foo/?bar=baz') at 0x291bb90>  # note the added slash
>>> url = '/foo/'
>>> URLObject(url).with_query('bar=baz')
<URLObject(u'/foo//?bar=baz') at 0x291bb30> # note the added slash
here, too
```

Not sure how 0.6.0, the version in requirements.txt, behaves.

On Feb 21, 9:31 pm, poswald <paulosw...@gmail.com> wrote:
> Worth noting.. if you use virtualenv with distribute, you may have to
> upgrade your env due to the way that URLObject 2.0 is packaged. I got
> an error telling me I need distribute >= 0.6.24. See also:
>
> https://github.com/zacharyvoase/urlobject/commit/654f4e35cb81b6bcfed0...

sebastibe

unread,
Apr 23, 2012, 8:43:21 PM4/23/12
to django-res...@googlegroups.com
I also got an error with with_query_param and URLObject 0.6. The encoding ToASCII in URLObject 0.6 has a 63-character limit which was causing templates to crash with long urls. Update to URLObject 2.0.1 solved the issue.


Here's what it was doing:

Exception Value:
Caught UnicodeError while rendering: label empty or too long
Exception Location: /Users/dlador/Dev/domous/lib/python2.7/encodings/idna.py in ToASCII, line 73
Reply all
Reply to author
Forward
0 new messages