Swaps app

3 views
Skip to first unread message

Steve

unread,
Apr 24, 2009, 12:15:09 PM4/24/09
to Pinax Users
Running the new beta verstion, I'm having a problem with the Accpted
and Dead pages of the swaps app, getting this msg:

instancemethod expected at least 2 arguments, got 0

I see that django-swaps has a new 0.5.3 version so I'm wondering if
upgrading would fix things but I don't really understand the new pinax
download/update methodology so I don't know how to get it to recognize
and pull the new version of that app. What do I do?

bobhaugen

unread,
Apr 25, 2009, 11:21:48 AM4/25/09
to Pinax Users
On Apr 24, 11:15 am, Steve <money...@gmail.com> wrote:
> What do I do?

I'll check it out and see what needs fixing this weekend, but don't
have a lot of time.

In the meantime, you could comment out swaps in INSTALLED_APPS, or
just ignore those pages until I come back with a positive response.

Sorry about the problem, swaps might be out of sync with the recent
Pinax updates.

-Bob Haugen

bobhaugen

unread,
Apr 25, 2009, 11:57:25 AM4/25/09
to Pinax Users
Steve,

I just installed http://downloads.pinaxproject.com/pinax-0.7beta2.tar.gz

I'm running on Ubuntu 7.10.

I do not experience those swaps problems.

Which release did you install, what OS, and did you follow the
virtualenv instructions?

And do these problems occur when you first click the Accepted and Dead
links, or after you have some accepted and dead swaps?

Steve

unread,
Apr 25, 2009, 12:29:14 PM4/25/09
to Pinax Users
Hi Bob, thanks for looking into this.

I'm on Webfaction which I believe is CentOS 5. uname -a shows this:
Linux version 2.6.18-92.1.22.el5PAE (mock...@builder16.centos.org)
(gcc version 4.1.2 20071124 (Red Hat 4.1.2-42))

And yes, I did use the virtualenv instructions.

Unfortunately I don't recall if this problem occurred when I first
clicked or after some accepted and dead swaps occurred. I remember
doing just a cursory test of the swaps app when I first did the Pinax
installation and just got around to revisiting it now. Is there a
particular circumstance that you suspect is causing this? Since I
don't have real users on my system yet I can just drop the swaps
tables completely from the db and re-add them if that will clear the
problem, but would like to know what caused this so I can prevent it
from happening again.

Thanks,
-Steve

bobhaugen

unread,
Apr 25, 2009, 5:29:46 PM4/25/09
to Pinax Users
Steve,

I tried this with and without dead and accepted swaps, still did not
recreate the problem.

But I'm running locally, with python 2.5, sqlite3 and Django 1.02.

How about you?

I did find this, that references the same error message:
http://code.djangoproject.com/ticket/7204

Says it's about cloning querysets, and it's fixed, so it might be
irrelevant. Also says the underlying cause is http://bugs.python.org/issue1515
which apparently has been fixed in 2.6, so is probably not involved
here.

Here's the code that is probably causing the error, from the accepted
swaps view:

swaps = Swap.objects.filter(
Q(state=2, proposing_offer__offerer=request.user) |
Q(state=2, responding_offer__offerer=request.user)).order_by("-
accepted_time")

Anybody know why that would cause "instancemethod expected at least 2
arguments, got 0"?

Especially in some situations but not others?

BraneSKS

unread,
Apr 25, 2009, 6:04:52 PM4/25/09
to pinax...@googlegroups.com
I only seem to run into the swaps error when using postgresql-
psycopg2. Mysql seemed to work fine but there is no way I would use it
in production.

Sent from my iPhone

Steve

unread,
Apr 25, 2009, 6:19:22 PM4/25/09
to Pinax Users
I'm running python 2.5, MySQL 5.0.45, Django 1.02, and yes, you're
correct about the lines of code that are referenced in the error when
accessing the Accepted Swaps page. And naturally for the Dead Swaps
page, it's these:

swaps = Swap.objects.filter(
Q(state__gt=3, proposing_offer__offerer=request.user) |
Q(state__gt=3,
responding_offer__offerer=request.user)).order_by("-killed_time")

I have now dropped both swaps tables (swaps_offer and swaps_swap) and
added them back via a syncdb and am still getting the same errors with
the tables completely empty.

bobhaugen

unread,
Apr 26, 2009, 8:04:31 AM4/26/09
to Pinax Users
Steve, can you please post a complete debug error listing on dpaste?

Steve

unread,
Apr 26, 2009, 10:29:42 AM4/26/09
to Pinax Users
Hi Bob, here it is: http://dpaste.com/38000/

bobhaugen

unread,
Apr 26, 2009, 10:54:12 AM4/26/09
to Pinax Users
On Apr 26, 9:29 am, Steve <money...@gmail.com> wrote:
> Hi Bob, here it is: http://dpaste.com/38000/

Thanks. Looks like the python deepcopy bug.

Reported on django-users to see if anybody has any suggestions over
there:
http://groups.google.com/group/django-users/browse_thread/thread/4d276af18427dde4

If not, I got some ideas I will try later today.

Steve

unread,
Apr 26, 2009, 1:04:14 PM4/26/09
to Pinax Users
Found the culprit!!! I was working on implementing site search with
django-search-lucene and this middleware is apparently causing the
problem:

'search.middleware.LuceneMiddleware'

I commented it out and voila, everything works. I just submitted the
issue to the django-search-lucene project.

Thanks again for helping with this Bob!
Reply all
Reply to author
Forward
0 new messages