Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools
Board » General » Smoother upgrades?

Page: 1 2 3 Next

I'm in the process of upgrading my site to the latest Django and SCT trunks, and it's proving quite difficult to manage the schema evolution and other issues.

For automation, the django_evolution app is completely useless in this case because of backwards-incompatible changes in Django, and deseb almost works. I had to add an explicit default to one of SCT's fields because of http://code.google.com/p/deseb/issues/detail?id=24 but I'm still getting the following traceback when I visit the "forums" link: http://dpaste.com/39753/

Any ideas?

Thanks
Dave Abrahams
Boostpro Computing
http://www.boostpro.com
Having found http://sct.sphene.net/board/thread/429, I added

(r'^community/community/', include('sphene.community.urls'), defaultdict),

to my urlconf and it started working again. However, then I end up with urls like "http://boostcon.com/community/community/profile/edit/3/" because I was already using http://boostcon.com/community for something. Is there any way to tune that URL?

Thanks again for the wonderful software!
Dave Abrahams
Boostpro Computing
http://www.boostpro.com
One more issue I'm seeing is in the admin interface: http://dpaste.com/39756/

Thanks for your attention
Dave Abrahams
Boostpro Computing
http://www.boostpro.com
David Abrahams said @ 2008-03-17 03:06:29:
to my urlconf and it started working again. However, then I end up with urls like "http://boostcon.com/community/community/profile/edit/3/" because I was already using http://boostcon.com/community for something. Is there any way to tune that URL?
well .. it shouldn't be a problem to simply rename the url .. for example to .. community/core or .. similar :) i think i now use reverse lookups for all URLs .. so it shouldn't be a problem to use any URLs you like .. (and .. if you encounter any left over hard coded URLs let me know so i can replace them)


David Abrahams said @ 2008-03-17 03:12:05:
One more issue I'm seeing is in the admin interface: http://dpaste.com/39756/


ok, this is weird.. i have never tried editing roles in the admin interface.. i'll have to check it ..
but .. simply use SCT's interface to modify roles /community/admin/permission/role/list/ (or in your case probably /community/community/admin/permission/role/list/ )
Hey, we have Signatures !!! Great, isn't it ? ;)
David Abrahams said @ 2008-03-17 03:06:29:
to my urlconf and it started working again. However, then I end up with urls like "http://boostcon.com/community/community/profile/edit/3/" because I was already using http://boostcon.com/community for something. Is there any way to tune that URL?
well .. it shouldn't be a problem to simply rename the url .. for example to .. community/core or .. similar :) i think i now use reverse lookups for all URLs .. so it shouldn't be a problem to use any URLs you like .. (and .. if you encounter any left over hard coded URLs let me know so i can replace them)
How can I do that without patching the SCT source? I think a guide is missing here...

David Abrahams said @ 2008-03-17 03:12:05:
One more issue I'm seeing is in the admin interface: http://dpaste.com/39756/
ok, this is weird.. i have never tried editing roles in the admin interface.. i'll have to check it ..


OK, if I make the following change the problem disappears:
--- models.py	(revision 481)
+++ models.py	(working copy)
@@ -218,7 +218,8 @@
         unique_together = (('name', 'group'),)
 
     class Admin:
-        ordering = ('group', 'name')
+        pass
+    #    ordering = ('group', 'name')
 
 
 class RoleMember(models.Model):


but .. simply use SCT's interface to modify roles /community/admin/permission/role/list/ (or in your case probably /community/community/admin/permission/role/list/ )



I didn't know that was there; I'll check it out, thanks.
Dave Abrahams
Boostpro Computing
http://www.boostpro.com
David Abrahams said @ 2008-03-17 08:48:34:
well .. it shouldn't be a problem to simply rename the url .. for example to .. community/core or .. similar :) i think i now use reverse lookups for all URLs .. so it shouldn't be a problem to use any URLs you like .. (and .. if you encounter any left over hard coded URLs let me know so i can replace them)
How can I do that without patching the SCT source? I think a guide is missing here...
hmm.. you only need to change your URL conf - you added

(r'^community/community/', include('sphene.community.urls'), defaultdict),

simply change that to community/core/ ?


David Abrahams said @ 2008-03-17 08:48:34:
OK, if I make the following change the problem disappears:


hmm.. weird.. thanks for finding that out - i'll look at it when i get home..
Hey, we have Signatures !!! Great, isn't it ? ;)
David Abrahams said @ 2008-03-17 08:48:34:
well .. it shouldn't be a problem to simply rename the url .. for example to .. community/core or .. similar :) i think i now use reverse lookups for all URLs .. so it shouldn't be a problem to use any URLs you like .. (and .. if you encounter any left over hard coded URLs let me know so i can replace them)
How can I do that without patching the SCT source? I think a guide is missing here...
hmm.. you only need to change your URL conf - you added

(r'^community/community/', include('sphene.community.urls'), defaultdict),

simply change that to community/core/ ?
Wow, it's really that simple? I'll obviously have to learn more about this reverse lookup thingy. It doesn't even seem possible on the face of it.

David Abrahams said @ 2008-03-17 08:48:34:
OK, if I make the following change the problem disappears:
hmm.. weird.. thanks for finding that out - i'll look at it when i get home..



Thanks. I've got a couple of others for you, too... ;-)

First, I tried to create a new role and got
Environment:

Request Method: POST
Request URL: http://localhost:8000/community/community/admin/permission/role/create/
Django Version: 0.97-pre-SVN-unknown
Python Version: 2.5.1
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.admin',
 'django.contrib.markup',
 'boost_consulting.news',
 'boost_consulting.pages',
 'boost_consulting.conference',
 'boost_consulting.accounts',
 'boost_consulting.ecommerce',
 'boost_consulting.shipping',
 'stockphoto',
 'sphene.community',
 'sphene.sphboard',
 'sphene.sphwiki',
 'boost_consulting.communitytools_support',
 'django.contrib.humanize']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.middleware.doc.XViewMiddleware',
 'sphene.community.middleware.ThreadLocals',
 'sphene.community.middleware.GroupMiddleware',
 'sphene.community.middleware.MultiHostMiddleware',
 'sphene.community.middleware.PermissionDeniedMiddleware')


Traceback:
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py" in get_response
  82.                 response = callback(request, *callback_args, **callback_kwargs)
File "/home/dave/src/site/boostcon-trunk/boost_consulting/communitytools/sphenecoll/sphene/community/views.py" in admin_permission_role_edit
  376.                 r.permission_flags.add( PermissionFlag.objects.get( name = flag_name ) )
File "/usr/lib/python2.5/site-packages/django/db/models/manager.py" in get
  69.         return self.get_query_set().get(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/django/db/models/query.py" in get
  263.             raise self.model.DoesNotExist, "%s matching query does not exist." % self.model._meta.object_name

Exception Type: DoesNotExist at /community/community/admin/permission/role/create/
Exception Value: PermissionFlag matching query does not exist.


Then I decided maybe I needed a syncdb, so I tried that and got
2007-08-10 00: SQL Statement: ALTER TABLE "community_communityuserprofile" ADD avatar varchar(100)
2007-08-10 01: SQL Statement: ALTER TABLE "community_communityuserprofile" ADD avatar_height integer
2007-08-10 02: SQL Statement: ALTER TABLE "community_communityuserprofile" ADD avatar_width integer
Detected changes - Do you want to execute SQL Statements ? (yes,no): yes
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 272, in execute_manager
    utility.execute()
  File "/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line 219, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 72, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 86, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py", line 168, in handle
    return self.handle_noargs(**options)
  File "/usr/lib/python2.5/site-packages/django/core/management/commands/syncdb.py", line 97, in handle_noargs
    emit_post_sync_signal(created_models, verbosity, interactive)
  File "/usr/lib/python2.5/site-packages/django/core/management/sql.py", line 491, in emit_post_sync_signal
    verbosity=verbosity, interactive=interactive)
  File "/usr/lib/python2.5/site-packages/django/dispatch/dispatcher.py", line 360, in send
    **named
  File "/usr/lib/python2.5/site-packages/django/dispatch/robustapply.py", line 47, in robustApply
    return receiver(*arguments, **named)
  File "/home/dave/src/site/boostcon-trunk/boost_consulting/../boost_consulting/communitytools_support/models.py", line 129, in do_changelog
    curs.execute( sqlstmt )
  File "/usr/lib/python2.5/site-packages/django/db/backends/util.py", line 18, in execute
    return self.cursor.execute(sql, params)
psycopg2.ProgrammingError: column "avatar" of relation "community_communityuserprofile" already exists


So it looks like I'm still having some kind of DB evolution problems
Dave Abrahams
Boostpro Computing
http://www.boostpro.com
Hmm, that's interesting. In my last post, the preview showed the [ code]...[ /code] sections as single-spaced, but they show up as double-spaced now
Dave Abrahams
Boostpro Computing
http://www.boostpro.com
David Abrahams said @ 2008-03-17 09:19:25:
Wow, it's really that simple? I'll obviously have to learn more about this reverse lookup thingy. It doesn't even seem possible on the face of it.
it's a bit magic on django's part.. trying to fiddle parameters back into a regex :) but it works better than it sounds ..

David Abrahams said @ 2008-03-17 09:19:25:
So it looks like I'm still having some kind of DB evolution problems


it very much looks like it .. probably because of the automatic schema evolution you tried out ;)
for sct it might be safer to just follow those changelog statements i added to the models..

still .. this doesn't fully explain all your exceptions :(


David Abrahams said @ 2008-03-17 09:22:40:
Hmm, that's interesting. In my last post, the preview showed the [ code]...[ /code] sections as single-spaced, but they show up as double-spaced now


i've noticed that one before .. :(
since it's the same code that renders the output .. there must be some difference when urlencoding in javascript vs. sending a POST form..
Hey, we have Signatures !!! Great, isn't it ? ;)
David Abrahams said @ 2008-03-17 09:19:25:
So it looks like I'm still having some kind of DB evolution problems
it very much looks like it .. probably because of the automatic schema evolution you tried out ;)
for sct it might be safer to just follow those changelog statements i added to the models..
Sorry, how does one "follow a changelog statement?" Is this some new Django feature I don't know about?
Dave Abrahams
Boostpro Computing
http://www.boostpro.com

Page: 1 2 3 Next

Please login to post a reply.



Powered by Sphene Community Tools