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

Opportunity Access model and migrations #41

Merged
merged 5 commits into from
Aug 3, 2023

Conversation

pxwxnvermx
Copy link
Contributor

No description provided.

@pxwxnvermx pxwxnvermx marked this pull request as ready for review July 31, 2023 09:39
@pxwxnvermx pxwxnvermx self-assigned this Jul 31, 2023
Copy link
Collaborator

@calellowitz calellowitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple questions on this. It seems like it went a slightly different direction than we discussed on the ticket.



class OpportunityAccess(models.Model):
user = models.OneToOneField(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a key to the actual User model, not ConnectUser

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. 45f8e61

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@@ -69,3 +69,15 @@ class Role(models.TextChoices):
related_name="memberships",
)
role = models.CharField(max_length=20, choices=Role.choices, default=Role.MEMBER)


class ConnectUser(BaseModel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned on the ticket, I don't think these fields are quite right and we should hold off on adding this data until the details of ConnectID/Connect authentication are finished. As mentioned in the other comment, I don't think this is necessary for this PR either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed ConnectUser. 45f8e61

@@ -70,3 +70,18 @@ class DeliverForm(models.Model):

def __str__(self):
return self.name


class OpportunityAccess(models.Model):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to the other fields on this model? I know we mentioned not creating ones that referenced uncreated models, but some of the fields in the spec were specfic to this one and are still missing. Is that intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other fields which are not included in this PR include learn_progress, visit_count, and last_visit_date, these are properties that will be computed based on other models i.e. LearnModule and UserVisit models respectively.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date_claimed is the one I was thinking of. Agree that the others are not necessary yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added. 4ad1eaf

user = models.OneToOneField(
ConnectUser,
on_delete=models.CASCADE,
related_name="claims",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think you want to call these claims (default is probably fine, to be honest), since you can have access without yet having claimed the opportunity. In other words, some of these rows represent claims but some do not, so naming them like that is confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. 4ad1eaf

opportunity = models.ForeignKey(
Opportunity,
on_delete=models.CASCADE,
related_name="claims",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment about naming

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. 4ad1eaf

@@ -70,3 +70,18 @@ class DeliverForm(models.Model):

def __str__(self):
return self.name


class OpportunityAccess(models.Model):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date_claimed is the one I was thinking of. Agree that the others are not necessary yet.



class OpportunityAccess(models.Model):
user = models.OneToOneField(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@pxwxnvermx pxwxnvermx changed the title Opportunity Access and Connect User models and migrations Opportunity Access model and migrations Aug 2, 2023
@pxwxnvermx pxwxnvermx merged commit 561866b into main Aug 3, 2023
2 checks passed
@pxwxnvermx pxwxnvermx deleted the pkv/add-opportunity-claim-model branch August 3, 2023 05:31
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.

3 participants