openhatch

Issue521

Title Can't edit project description on project page
Milestone Priority bug
Waiting On Status resolved
Superseder Nosy List aldeka, gehrhorn, paulproteus
Assigned To Keywords bitesize

Created on 2011-08-07.07:12:41 by aldeka, last changed 2013-03-20.23:59:39 by paulproteus.

Messages
msg3644 (view) Author: paulproteus Date: 2013-03-20.23:59:39
Now you can do this, via the /+projedit/ URLs. Marking as resolved.
msg3437 (view) Author: gehrhorn Date: 2012-09-27.15:11:21
I think this is the intended behavior. 

1. mysite/project/urls.py calls mysite.project.views.project(request, 
project__name)

2. That function initializes an empty dictionary called "context". It adds a key 
'random_pfentry' with a value returned by p.get_random_description() where 'p' is 
the Project object. 

3. In mysite/search/models.py (the Project models are in the Search app) the 
function get_random_description() builds a list called pfentries from a call to 
self.get_pfentries_with_usable_descriptions(), which builds its list from 
get_pfentries_with_descriptions. 

4. pfentries gets contstructed in the get_pfentries_with_descriptions() function. 
It generates a list (from a QuerySet?) of projects, but it excludes all projects 
that have a project_description == "".

5. Back to get_random_description(). If pfentries is an non-empty list, 
get_random_description() returns a random list item. If pfentries is an empty list, 
get_random_description() returns None.

6. In mysite/project/templates/project/project.html (the template that renders the 
project page), there is a conditional {%if random_pfentry %}. If this is true (i.e. 
the context['random_pfentry'] value is not None, the template renders the supplied 
project_description value that was chosen in step 5. If the conditional is false 
(i.e. step 5 returned None) then the template renders a message saying that "no one 
has described this project yet". 

Effectively, this functionality pulls the description from a random user's 
description of the project (provided at least one user has described the project). 
If you add a project to your profile and open up your portfoloio editor 
(http://openhatch.org/+portfolio/editor/) you can add your description of the 
project. This will be part of the set of desciptions that step 5 chooses at random. 

I think the intent is for this page to show how different users have described the 
project.

If I've misinterpreted anything and someone more knowledgeable than I wants to 
weigh in I'd be glad to know where I erred.
msg2268 (view) Author: aldeka Date: 2011-08-07.07:12:40
Right now, the project page takes the project description (in the "About {{ 
project.name }}" box) from some random contributor's profile, as far as I can tell. 
Which is perfectly fine default behavior. But there's no way for a project 
maintainer to change or improve the description -- that field isn't included in the 
project page editor. :P
History
Date User Action Args
2013-03-20 23:59:39paulproteussetstatus: chatting -> resolved
messages: + msg3644
2012-09-27 15:17:02gehrhornsetnosy: + gehrhorn
2012-09-27 15:11:21gehrhornsetstatus: unread -> chatting
messages: + msg3437
2011-08-07 07:12:41aldekacreate