Posted by Daniel Ellison |
|
Hey, where's "var/sphene/community/avatar/" located on your system? Do you have another static entry somewhere? The CommunityUserProfile model specifies this as its upload_to target. Needless to say, I don't have that path on my system... "Never quote yourself" -- Daniel Ellison |
|
Posted by Herbert Poul |
|
Yes exactly, it is a static media path .. relative to your MEDIA_ROOT
Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Herbert Poul |
|
have you got it working ? :) - and another thing - can you please take a look at my post here: http://sct.sphene.net/board/thread/281/ "Advanced permissions (for the board)" it discusses ways on how the permission system in SCT could be improved - might be also interesting for the thread based permissions (although i don't mention it in the post.. i would probably simply implement it in the same way as the category permissions after all). Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Daniel Ellison |
|
Yes, I got it working. Looks great! :) I'll hop on over to the new thread and see what you've come up with for permissions. Thanks! "Never quote yourself" -- Daniel Ellison |
|
Posted by Herbert Poul |
|
sooo... counting views + 'hot' threads are now implemented..
i have now restructured the models of the board so that Threads do have their own entity (\ThreadInformation) .. in it i store things like post count, view count, heat, etc. i hope this makes the thread list faster.. the heat is currently calculated whenever a user posts a thread.. but it is ment to be executed periodically through a cronjob .. (e.g. daily) for example: echo -e "from sphene.community.signals import trigger_maintenance\ntrigger_maintenance()" | ./manage.py shell --plain users can customize the method beeing used to calculate the heat using the SPH_SETTING board_heat_calculator - which is called with three arguments: thread (the \ThreadInformation object), postcount (number of posts in the last x days - x beeing the setting board_heat_days), viewcount (number of total views), age (days since the first post) - it then returns a integer value.. where >0 represents a "hot" thread.. (this way it would also be possible to display a list of the hottest threads.. not just distinguish between hot threads and all others) If you hover over a thread-icon in the threadlist on this website (at least in firefox - it's the title=".." attribute.. i don't think IE interprets it) you should see the 'Heat' of the thread :) I still need to document this stuff somewhere .. ;) --- Last Edited by Herbert Poul at 2007-08-12 17:28:45 --- Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Daniel Ellison |
|
Wow, that's great! It looks like the most versatile solution anyone could ask for. Thanks, Herbert.
So, since you modifed the database that much it's probably time to wipe my test data and build it up from scratch. There wasn't a lot there anyway. I did notice that you have changelogs in your models. How are those used? "Never quote yourself" -- Daniel Ellison |
|
Posted by Herbert Poul |
|
simply run syncdb .. it should work without problems (it did at least for me ;) )
the changelog i'm using is for modifying columns .. since the ThreadInformation is a new table the 'syncdb' from django does it out of the box .. if there is a changelog to apply you will see the SQL statements it will execute when running syncdb .. if you are not using postgresql you might need to slightly change those statements.. (if you are interested in how exactly the changelog works.. look at my djangosnippets post: http://www.djangosnippets.org/snippets/289/) Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Daniel Ellison |
|
Worked out of the box. :)
I'm using sqlite3 for development. I'm more familiar with MySQL, so I'll have to look up the differences there. But it shouldn't be a problem. "Never quote yourself" -- Daniel Ellison |
|
Posted by Herbert Poul |
|
soo...
i'm starting to really love python + django .. on the one end .. 'svn commit' on the other .. 'svn update', './manage.py syncdb', '/etc/init.d/apache2 reload' .. and there is a new feature online ;) http://sct.sphene.net/board/thread/249/ - annotating and hiding user posts (if a post is hidden it can only be seen by editing it - this wouldn't make it visible of course) btw. i think the heat calculation needs some re-balancing .. we have 3 hot topics in this category :) Hey, we have Signatures !!! Great, isn't it ? ;) |
|
Posted by Daniel Ellison |
|
It makes life so much easier, doesn't it? :)
Fantastic! I'll update right away and try it out. Thanks so much, Herbert! "Never quote yourself" -- Daniel Ellison |