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

Feature/55 #152

Merged
merged 17 commits into from
Jul 8, 2022
Merged

Feature/55 #152

merged 17 commits into from
Jul 8, 2022

Conversation

jumcorredorro
Copy link
Contributor

@jumcorredorro jumcorredorro commented Jul 5, 2022

Description

  • Creates a new Model called "Campaign" that groups Drips through the CampaignDrip intermediate Model. Also allows the lib's user to configure the Drip Model to be used inline.
  • Allows the user to decide if when a campaign is deleted it should delete also the drips related to it.
  • Build Timeline view for Campaign detail. Grouping by timeline.

Closes issue(s)

#55

Screenshots (if appropriate)

image

Changes include

  • Bugfix (non-breaking change that solves an issue, bump the third digit of the version)
  • New feature (non-breaking change that adds functionality, bump the second digit of the version)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality, bump the first digit of the version)
  • Documentation update (Don't bump the version of the project)

Other comments

@jumcorredorro jumcorredorro linked an issue Jul 5, 2022 that may be closed by this pull request
@jumcorredorro jumcorredorro marked this pull request as ready for review July 6, 2022 18:41
@jumcorredorro jumcorredorro requested a review from a team as a code owner July 6, 2022 18:41
@jumcorredorro jumcorredorro requested review from brunomichetti, MathiasLantean, JorgeMichelena and malexandroff1 and removed request for a team July 6, 2022 18:41
Copy link
Collaborator

@brunomichetti brunomichetti left a comment

Choose a reason for hiding this comment

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

Nice job!!!!
Two questions:
Are you changing the docs in another PR?
What about the User class, shouldn't be related to Campaigns?


shifted_drips = []
for drip in campaign.drip_set.all():
seen_users: Set[int] = set()
Copy link
Collaborator

Choose a reason for hiding this comment

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

We aren't indicating the type of the variables, you can remove this if you want. Not mandatory

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I leave like this because of mypy.



class Campaign(models.Model):
name = models.CharField(max_length=256, default="Unnamed Campaign")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could remove the default since it's mandatory

@@ -42,6 +42,15 @@ class AbstractDrip(models.Model):
)
message_class = models.CharField(max_length=120, blank=True, default="default")

campaign = models.ForeignKey(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't a drip be related to more than one Campaing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now it only can be related to one campaign, we could talk about this in the future. WDYT?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should discuss if it does make sense a N to 1 relationship or N to N relationship. Maybe we can discuss it tomorrow. I think that since you are making this big PR, we should define this before the documentation changes

@jumcorredorro
Copy link
Contributor Author

jumcorredorro commented Jul 6, 2022

@brunomichetti
About your questions:
Are you changing the docs in another PR?

  • Yes, the last PR will be documentation for this and then a release. WDYT?

What about the User class, shouldn't be related to Campaigns?

  • I don't think this is needed, the relation could be reached using the drip and I think if we change the user model it could be harder to extend this functionality for other developers.

@brunomichetti
Copy link
Collaborator

@brunomichetti About your questions: Are you changing the docs in another PR?

  • Yes, the last PR will be documentation for this and then a release. WDYT?

What about the User class, shouldn't be related to Campaigns?

  • I don't think this is needed, the relation could be reached using the drip and I think if we change the user model it could be harder to extend this functionality for other developers.

@jumcorredorro what if the user wants to leave the whole campaign?

@jumcorredorro
Copy link
Contributor Author

@brunomichetti maybe in the future when we allow the users to get out of the campaign but this is not contemplated here. 🤔

Copy link
Collaborator

@malexandroff1 malexandroff1 left a comment

Choose a reason for hiding this comment

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

LG2M

@jumcorredorro jumcorredorro merged commit 203e674 into develop Jul 8, 2022
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.

Campaigns
4 participants