Conflate all department/departments plus attendees

Bug #360659 reported by Paul Everitt
2
Affects Status Importance Assigned to Milestone
KARL3
Fix Released
Low
Chris Rossi

Bug Description

I believe that we have some skew in department vs. departments, with some repetition/duplication in models, formfields, zpt snippets, etc.

For example, baseforms.py has this:

department = validators.UnicodeString(strip=True)
departments = CommaSplitter(strip=True)

I believe the way it should work is this:

a. Affiliates get to edit their departments. Staff do not see this on their profile. However, this will be assigned by the sync application (you might need to email osi-dev to see if Jason is sending you a sequence, comma-sep string, whatever.)

b. When the field is displayed on the form, it is coerced from a sequence to a comma-separated string.

c. It is stored as a list.

d. The View Profile and the two views (pictures and listing) for community membership need to show it as comma-sep.

If possible, get rid of the department field in baseforms, change occurrences of it to use departments, then fix the zpts that display the values to be consistent. Use the tal:condition test for last value in a sequence to stitch things together with a comma (or don't use tal:repeat on the values, and instead do ${', '.join(profile.departments)}.

UPDATE
===========

The Attendees field on calendar events has a similar problem. If you add an event with multiple

TO DO
======

1) Get rid of the CommaSplitter validator in baseforms. I don't think anything is using it, but make sure.

2) Find all the places the use department, departments, or attendees as either form fields or display on a page. (Accept Invitation, Edit Profile, Show Profile, Community Members, possibly in karl.peopledir, Show Calendar Event, Add/Edit Calendar Event.)

3) Replace the ZPT with a snippet for display, using semicolons to join. Replace the formfield with textarea-oriented snippets.

4) Make sure the formfield for departments and for attendees has some help text explaining that each line is a value.

5) Make sure it says "Departments" plural. For this one, the help text should also explain that the first value is the "primary" department.

6) Add a _from_python to the TextAreaToList for co-ercion, rather then doing this in the add/edit views.

7) Make sure the unit and twill tests pass.

description: updated
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Hi Chris. This bug exhibited itself when I created an affiliate (who can edit their Department value) and added them to a community. When clicking on Members in the community I saw ['department1', 'department2'] in the little orange box.

Changed in karl3:
assignee: nobody → chris-archimedeanco
importance: Undecided → Low
milestone: none → m10
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Chris, this one got more complicated, but I'd like to drive a stake in the heart of this.

description: updated
summary: - Conflate all department/departments
+ Conflate all department/departments plus attendees
Changed in karl3:
status: New → In Progress
Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

Hi Paul, it looks like the "Update" part got cut off mid-sentence. What did you want to say there?

Revision history for this message
Paul Everitt (paul-agendaless) wrote : Re: [Bug 360659] Re: Conflate all department/departments plus attendees

Sorry, you're right.

If you add a calendar event with multiple attendees, then click Edit,
you'll see the Python list representation as a string:

   ['paul', 'chris']

Repeated save-edit-save-edit makes it worse.

--Paul

On Apr 14, 2009, at 10:26 AM, Chris Rossi wrote:

> Hi Paul, it looks like the "Update" part got cut off mid-sentence.
> What
> did you want to say there?
>
> --
> Conflate all department/departments plus attendees
> https://bugs.launchpad.net/bugs/360659
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Porting KARL to a new architecture: In Progress
>
> Bug description:
> I believe that we have some skew in department vs. departments, with
> some repetition/duplication in models, formfields, zpt snippets, etc.
>
> For example, baseforms.py has this:
>
> department = validators.UnicodeString(strip=True)
> departments = CommaSplitter(strip=True)
>
>
> I believe the way it should work is this:
>
> a. Affiliates get to edit their departments. Staff do not see this
> on their profile. However, this will be assigned by the sync
> application (you might need to email osi-dev to see if Jason is
> sending you a sequence, comma-sep string, whatever.)
>
> b. When the field is displayed on the form, it is coerced from a
> sequence to a comma-separated string.
>
> c. It is stored as a list.
>
> d. The View Profile and the two views (pictures and listing) for
> community membership need to show it as comma-sep.
>
> If possible, get rid of the department field in baseforms, change
> occurrences of it to use departments, then fix the zpts that display
> the values to be consistent. Use the tal:condition test for last
> value in a sequence to stitch things together with a comma (or don't
> use tal:repeat on the values, and instead do ${',
> '.join(profile.departments)}.
>
> UPDATE
> ===========
>
> The Attendees field on calendar events has a similar problem. If
> you add an event with multiple
>
> TO DO
> ======
>
> 1) Get rid of the CommaSplitter validator in baseforms. I don't
> think anything is using it, but make sure.
>
> 2) Find all the places the use department, departments, or attendees
> as either form fields or display on a page. (Accept Invitation,
> Edit Profile, Show Profile, Community Members, possibly in
> karl.peopledir, Show Calendar Event, Add/Edit Calendar Event.)
>
> 3) Replace the ZPT with a snippet for display, using semicolons to
> join. Replace the formfield with textarea-oriented snippets.
>
> 4) Make sure the formfield for departments and for attendees has
> some help text explaining that each line is a value.
>
> 5) Make sure it says "Departments" plural. For this one, the help
> text should also explain that the first value is the "primary"
> department.
>
> 6) Add a _from_python to the TextAreaToList for co-ercion, rather
> then doing this in the add/edit views.
>
> 7) Make sure the unit and twill tests pass.

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

Languages is also using the CommaSplitter. I will leave as is, unless you want to convert languages to a TextArea as well.

Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Jonathan said we can make Languages into a textareatolist also.

--Paul

On Apr 14, 2009, at 11:03 AM, Chris Rossi wrote:

> Languages is also using the CommaSplitter. I will leave as is, unless
> you want to convert languages to a TextArea as well.
>
> --
> Conflate all department/departments plus attendees
> https://bugs.launchpad.net/bugs/360659
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Porting KARL to a new architecture: In Progress
>
> Bug description:
> I believe that we have some skew in department vs. departments, with
> some repetition/duplication in models, formfields, zpt snippets, etc.
>
> For example, baseforms.py has this:
>
> department = validators.UnicodeString(strip=True)
> departments = CommaSplitter(strip=True)
>
>
> I believe the way it should work is this:
>
> a. Affiliates get to edit their departments. Staff do not see this
> on their profile. However, this will be assigned by the sync
> application (you might need to email osi-dev to see if Jason is
> sending you a sequence, comma-sep string, whatever.)
>
> b. When the field is displayed on the form, it is coerced from a
> sequence to a comma-separated string.
>
> c. It is stored as a list.
>
> d. The View Profile and the two views (pictures and listing) for
> community membership need to show it as comma-sep.
>
> If possible, get rid of the department field in baseforms, change
> occurrences of it to use departments, then fix the zpts that display
> the values to be consistent. Use the tal:condition test for last
> value in a sequence to stitch things together with a comma (or don't
> use tal:repeat on the values, and instead do ${',
> '.join(profile.departments)}.
>
> UPDATE
> ===========
>
> The Attendees field on calendar events has a similar problem. If
> you add an event with multiple
>
> TO DO
> ======
>
> 1) Get rid of the CommaSplitter validator in baseforms. I don't
> think anything is using it, but make sure.
>
> 2) Find all the places the use department, departments, or attendees
> as either form fields or display on a page. (Accept Invitation,
> Edit Profile, Show Profile, Community Members, possibly in
> karl.peopledir, Show Calendar Event, Add/Edit Calendar Event.)
>
> 3) Replace the ZPT with a snippet for display, using semicolons to
> join. Replace the formfield with textarea-oriented snippets.
>
> 4) Make sure the formfield for departments and for attendees has
> some help text explaining that each line is a value.
>
> 5) Make sure it says "Departments" plural. For this one, the help
> text should also explain that the first value is the "primary"
> department.
>
> 6) Add a _from_python to the TextAreaToList for co-ercion, rather
> then doing this in the add/edit views.
>
> 7) Make sure the unit and twill tests pass.

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

Paul,

The calendar event seems to already be doing the right thing with the attendees field.

Revision history for this message
Chris Rossi (chris-archimedeanco) wrote :

Department, in the singular form, is dead. Only departments, plural, remains.

Calendar Events attendees seemed to have already been done--I was unable to reproduce Paul's scenario. I did add help text to the field widget.

Moved profile languages to textarea from comma splitter. Updated display to use ";" seperator instead of comma, for consistency.

Changed in karl3:
status: In Progress → Fix Committed
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Awesome!

--Paul

On Apr 14, 2009, at 1:39 PM, Chris Rossi wrote:

> Department, in the singular form, is dead. Only departments, plural,
> remains.
>
> Calendar Events attendees seemed to have already been done--I was
> unable
> to reproduce Paul's scenario. I did add help text to the field
> widget.
>
> Moved profile languages to textarea from comma splitter. Updated
> display to use ";" seperator instead of comma, for consistency.
>
>
> ** Changed in: karl3
> Status: In Progress => Fix Committed

Changed in karl3:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.