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 » Integrating Sphene with existing site

Page: 1 2 3 Next

Hello there,

I'm running a community-based site for scientists, at http://researchpages.net (think myspace + facebook for researchers). At the moment it has a crap wiki app thrown together by me on a Friday afternoon(!) and no forum functionality (which is the next essential thing it needs).

The problem is that I already have my own groups, user profile model, middleware etc, so to integrate the sphene wiki and board into my site I will have to either

i) remove (or re-write) the community module and include my own data models or

ii) leave the community module in tact and create a sphene group for every one of my groups and a sphene 'user' for every one of my users.

I'm a bit of an ameteur when it comes to django (although I've achieved quite a lot already, I feel like I always find the hackiest and least pythonic way to do a particular thing) so I'd really appreciate a bit of advice on which way to go. If I'm honest, the sphene community module is much better than all of my similar efforts, so I should probably think about the second option and slowly migrating all my apps to work with the sphene community.

I'd really appreciate some advice

Many thanks

Martin
Hi,

well.. i don't think that there will be too many problems with the user profiles - SCT uses the usual django users for reference and only for profiles a custom class with more information, and i'm quite certain (although it wasn't tested before) that it should be quite easy to overload the SCT profile to use any other profile mechanism (it would probably boil down to changing the template of a template inclusion tag to link to your profile - and changing the templated used to display user info + avatar in the board)


the 'Group' model is a bit more complicated. Are you sure your group models have the same purpose ? SCT's community groups are basically ment to be "virtual sites" which don't have much in common .. so if you only have one site .. you can probably simply create one Group and that should be enough ..

i hope this makes any sense ? :)

thanks for your interest in SCT,
herbert
Hey, we have Signatures !!! Great, isn't it ? ;)
Hi Herbet, thanks for your thoughts - sounds like it might not be such a big job!

Although there is only one site, with multiple groups (not unlike Facebook groups, for example), I'd like each group to have its own forum, occurring at e.g. http://websiteurl/group-name/forum, so I guess each of these will need to be a sct group? Some hacking required there I guess?

Thanks again

Martin
ah ok .. i get it :)
although a bit of hacking will be necessary i guess the easiest way would be to use a modified version of the \GroupMiddleware.

the \GroupMiddleware in SCT reads out the 'groupName' parameter from the request and loads the SCT 'Group' from the database and puts it back into the request as 'group'.
You could do the same but after loading YOUR group model you look for a SCT group with the same name (or you add a reference to it from your models) - and if none is available simply create one in the code ..

i don't think this is hard to achieve .. and wouldn't require any additional work in your code (or in SCT's code)


--- Last Edited by Herbert Poul at 2007-10-18 13:56:43 ---
Hey, we have Signatures !!! Great, isn't it ? ;)
Fantastic! Thanks Herbert, I'll give it a try and let you know how I get on.

Best regards

Martin
i thought a bit more about the forum.. and discovered three problems you might encounter..

1. after creating a 'Group' object .. the board would show up, but without any category the user could post threads to .. so you would also need to create at least one 'Category' object ( sphene.board.models.Category )

2. this is probably more difficult ... permissions .. if you want all users to be able to create new threads and posts .. it isn't a problem .. simply set those permissions on the Category object .. it's more difficult if you want specific permissions to members of the group .. since you would need to synchronize the SCT Group members with your group objects ?

3. there is currently no GUI (except the django admin interface) for creating new forum Category objects. ie. you would need to do this either in your middleware, or an admin through the django admin... (This is on my todo list though :) .. but even if there is a way to create forum categories, we would probably be stuck with the 2. problem .. a way to figure out if a user is an admin of a specific group)


what do you think ? i guess users need different permissions on the forum if they are part of a group or not ?
Hey, we have Signatures !!! Great, isn't it ? ;)
Hi Herbert,

I've just got sphene set up with my django site installation and the admin site seems to be working fine. At the moment it's a bit broken, but getting there - trying to do it by changing sphene as little as possible and making the changes on my side for ease of sphene re-installation in the future.

Those problems don't worry me too much - I have methods to find whether a person is a group member and/or admin so I think I can call these methods as and when I need them with a bit of magic!

I can throw together a category form for admins - would you like me to send this back to you when it's working?

Many thanks

Martin
Martin Johnson said @ 2007-10-19 14:17:31:
seems to be working fine. At the moment it's a bit broken, but getting there - trying to do it by changing sphene as little as possible and making the changes on my side for ease of sphene re-installation in the future.
well .. the best would be if you woudn't need to change anything at all on the SCT code :) (except e.g. the middleware you could copy into your own modules) - if you've already started it might be easiest if you finish it, send me your changes and i see if it is possible to somehow make it generic enough to be included in SCT

(ie. providing pluggable APIs you can use to achieve a similar goal)

Martin Johnson said @ 2007-10-19 14:17:31:
I can throw together a category form for admins - would you like me to send this back to you when it's working?

sure would be cool .. - it would be even better if you try to minimize the use of modules of your application, so i don't have to rewrite everything :)

if you encounter any problems let me know ;)
Hey, we have Signatures !!! Great, isn't it ? ;)
Martin Johnson said @ 2007-10-19 14:17:31:
seems to be working fine. At the moment it's a bit broken, but getting there - trying to do it by changing sphene as little as possible and making the changes on my side for ease of sphene re-installation in the future.
well .. the best would be if you woudn't need to change anything at all on the SCT code :) (except e.g. the middleware you could copy into your own modules) - if you've already started it might be easiest if you finish it, send me your changes and i see if it is possible to somehow make it generic enough to be included in SCT

(ie. providing pluggable APIs you can use to achieve a similar goal)
Sure - this is the way to go. Longer term I think I will try to integrate more of the site with Sphene, in a less hacky way than a lot of it will be done in the next couple of weeks - it's a quick proof-of-concept at the moment.

Martin Johnson said @ 2007-10-19 14:17:31:
I can throw together a category form for admins - would you like me to send this back to you when it's working?
sure would be cool .. - it would be even better if you try to minimize the use of modules of your application, so i don't have to rewrite everything :)


No problem - I'll make this completely sphene and send it on to you when it's done.

if you encounter any problems let me know ;)


Just one problem - at the moment, there doesn't appear to be a group-specific admin privilege - i.e. user x cannot be admin for group y but not for group z. I would like to change this - how would you feel about a M2M field ('admins') on the 'Group' model (linking to the User model). This could be editable through the admin site. Any user listed as a group admin would then have permission to add categories / otherwise manage the group's forum / wiki.

Maybe there's a better way of doing this that I've missed. I'd welcome your thoughts.

Martin
sphboard ROCKS btw! :-)

Page: 1 2 3 Next

Please login to post a reply.



Powered by Sphene Community Tools