<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -70,6 +70,16 @@ That's it!  You have now paginated ``object_list`` and given users of the site
 a way to navigate between the different pages--all without touching your views.
 
 
+A Note About Uploads
+--------------------
+
+It is important, when using django-pagination in conjunction with file uploads,
+to be aware of when ``request.page`` is accessed.  As soon as ``request.page``
+is accessed, ``request.upload_handlers`` is frozen and cannot be altered in any
+way.  It's a good idea to access the ``page`` attribute on the request object 
+as late as possible in your views.
+
+
 Optional Settings
 ------------------
 </diff>
      <filename>docs/usage.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,17 @@
+def get_page(self):
+    &quot;&quot;&quot;
+    A function which will be monkeypatched onto the request to get the current
+    integer representing the current page.
+    &quot;&quot;&quot;
+    try:
+        return int(self.REQUEST['page'])
+    except (KeyError, ValueError, TypeError):
+        return 1
+
 class PaginationMiddleware(object):
     &quot;&quot;&quot;
     Inserts a variable representing the current page onto the request object if
     it exists in either **GET** or **POST** portions of the request.
     &quot;&quot;&quot;
     def process_request(self, request):
-        try:
-            request.page = int(request.REQUEST['page'])
-        except (KeyError, ValueError, TypeError):
-            request.page = 1
\ No newline at end of file
+        request.__class__.page = property(get_page)
\ No newline at end of file</diff>
      <filename>pagination/middleware.py</filename>
    </modified>
    <modified>
      <diff>@@ -30,32 +30,24 @@
 
 &gt;&gt;&gt; t = Template(&quot;{% load pagination_tags %}{% autopaginate var 2 %}{% paginate %}&quot;)
 
-# WARNING: Please, please nobody read this portion of the code!
-&gt;&gt;&gt; class GetProxy(object):
-...     def __iter__(self): yield self.__dict__.__iter__
-...     def copy(self): return self
-...     def urlencode(self): return u''
-...     def keys(self): return []
-&gt;&gt;&gt; class RequestProxy(object):
+&gt;&gt;&gt; from django.http import HttpRequest as DjangoHttpRequest
+&gt;&gt;&gt; class HttpRequest(DjangoHttpRequest):
 ...     page = 1
-...     GET = GetProxy()
-&gt;&gt;&gt;
-# ENDWARNING
 
-&gt;&gt;&gt; t.render(Context({'var': range(21), 'request': RequestProxy()}))
+&gt;&gt;&gt; t.render(Context({'var': range(21), 'request': HttpRequest()}))
 u'\\n\\n&lt;div class=&quot;pagination&quot;&gt;...
 &gt;&gt;&gt;
 &gt;&gt;&gt; t = Template(&quot;{% load pagination_tags %}{% autopaginate var %}{% paginate %}&quot;)
-&gt;&gt;&gt; t.render(Context({'var': range(21), 'request': RequestProxy()}))
+&gt;&gt;&gt; t.render(Context({'var': range(21), 'request': HttpRequest()}))
 u'\\n\\n&lt;div class=&quot;pagination&quot;&gt;...
 &gt;&gt;&gt; t = Template(&quot;{% load pagination_tags %}{% autopaginate var 20 %}{% paginate %}&quot;)
-&gt;&gt;&gt; t.render(Context({'var': range(21), 'request': RequestProxy()}))
+&gt;&gt;&gt; t.render(Context({'var': range(21), 'request': HttpRequest()}))
 u'\\n\\n&lt;div class=&quot;pagination&quot;&gt;...
 &gt;&gt;&gt; t = Template(&quot;{% load pagination_tags %}{% autopaginate var by %}{% paginate %}&quot;)
-&gt;&gt;&gt; t.render(Context({'var': range(21), 'by': 20, 'request': RequestProxy()}))
+&gt;&gt;&gt; t.render(Context({'var': range(21), 'by': 20, 'request': HttpRequest()}))
 u'\\n\\n&lt;div class=&quot;pagination&quot;&gt;...
 &gt;&gt;&gt; t = Template(&quot;{% load pagination_tags %}{% autopaginate var by as foo %}{{ foo }}&quot;)
-&gt;&gt;&gt; t.render(Context({'var': range(21), 'by': 20, 'request': RequestProxy()}))
+&gt;&gt;&gt; t.render(Context({'var': range(21), 'by': 20, 'request': HttpRequest()}))
 u'[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]'
 &gt;&gt;&gt;
 
@@ -128,4 +120,11 @@ True
 &gt;&gt;&gt; p2.previous_link()
 '/bacon/page/1'
 
+&gt;&gt;&gt; from pagination.middleware import PaginationMiddleware
+&gt;&gt;&gt; from django.core.handlers.wsgi import WSGIRequest
+&gt;&gt;&gt; from StringIO import StringIO
+&gt;&gt;&gt; middleware = PaginationMiddleware()
+&gt;&gt;&gt; request = WSGIRequest({'REQUEST_METHOD': 'POST', 'CONTENT_TYPE': 'multipart', 'wsgi.input': StringIO()})
+&gt;&gt;&gt; middleware.process_request(request)
+&gt;&gt;&gt; request.upload_handlers.append('asdf')
 &quot;&quot;&quot;
\ No newline at end of file</diff>
      <filename>pagination/tests.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8e03724287b7308d9111a388e2dfe698012f1c70</id>
    </parent>
  </parents>
  <author>
    <name>floguy</name>
    <email>floguy@7f1efe38-554e-0410-b69d-834cb44da2d5</email>
  </author>
  <url>http://github.com/ericflo/django-pagination/commit/a4832f53b911a85a3a7589b0ee3dfec77ea6c8a6</url>
  <id>a4832f53b911a85a3a7589b0ee3dfec77ea6c8a6</id>
  <committed-date>2009-03-29T23:38:08-07:00</committed-date>
  <authored-date>2009-03-29T23:38:08-07:00</authored-date>
  <message>Fixed a problem where the middleware accessed POST on every request, freezing upload_handlers at that point.

git-svn-id: https://django-pagination.googlecode.com/svn/trunk@49 7f1efe38-554e-0410-b69d-834cb44da2d5</message>
  <tree>8a323ab107e61e213d384ff4f718fa81cda19d42</tree>
  <committer>
    <name>floguy</name>
    <email>floguy@7f1efe38-554e-0410-b69d-834cb44da2d5</email>
  </committer>
</commit>
