Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TeamManageView and TeamInviteView CBVs #43

Merged
merged 2 commits into from
Mar 14, 2016

Conversation

jacobwegner
Copy link
Contributor

Rewrote the invite and management views as class-based views to allow further customization by the site developer.

A couple of things to highlight:

  • get_form_success_data and after_membership_added can be used to tie a newly created Membership to other business logic on a site.
  • Views use the manager_required decorator. Requires remove assumptions around auth.User model #40 before this PR can land (where staff users are considered managers of all teams)

@jtauber
Copy link
Member

jtauber commented Mar 9, 2016

On the question of "Determine if we want urls/views for SimpleTeam/SimpleMembership or just Team/Membership". I think what would typically happen in the "Simple" cases is there'd be urls/views for domain-specific objects that would involve operations on SimpleTeams/SimpleMemberships under the covers.

So for example, in Pinax LMS, adding (or inviting) a user to be an instructor on a course would, under the covers, be like adding or inviting them to a Simple Team. The CourseInstructorDetailView could subclass a SimpleTeamDetailView or could just make use of functionality provided by pinax-teams. I suggested to Greg Newman when this topic came up that we don't try to abstract prematurely and let's actually just write (for example) a one-off CourseInstructorDetailView and only factor out a base class once we have a few examples to see what the duplication of code is.

@jacobwegner
Copy link
Contributor Author

Ok @jtauber. That sounds like a sane approach for domain-specific objects.

I'm going to update this PR to replace the FBVs for manage/invite with these CBVs and will revisit the other FBVs down the line.

@jacobwegner jacobwegner changed the title WIP: add TeamManageView and TeamInviteView CBVs Add TeamManageView and TeamInviteView CBVs Mar 10, 2016
jacobwegner added a commit that referenced this pull request Mar 14, 2016
Add TeamManageView and TeamInviteView CBVs
@jacobwegner jacobwegner merged commit 69db10b into pinax:master Mar 14, 2016
@jacobwegner jacobwegner deleted the add-manage-and-invite-cbvs branch March 14, 2016 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants