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

1005 terms and conditions #1006

Merged
merged 17 commits into from
Nov 22, 2022
Merged

1005 terms and conditions #1006

merged 17 commits into from
Nov 22, 2022

Conversation

chrisjsimpson
Copy link
Contributor

@chrisjsimpson chrisjsimpson commented Nov 16, 2022

Ref #1005

  • Documents may be added (text with a name, a body, and a type)
  • Initially there are only two Document types: terms-and-conditions and generic
    • (So that documents may be filtered by type)
  • Documents may be assigned to a plan
  • A plan may have many or zero associated documents
  • As a shop owner I can link to terms & conditions to my plans
$ flask shell
Python 3.10.6 (main, Nov  2 2022, 18:53:38) [GCC 11.3.0] on linux
App: subscribie [development]
>>> from subscribie.models import Plan
>>> plans = Plan.query.all()
>>> plans
[<Plan 5>, <Plan 6>, <Plan 7>, <Plan 8>]
>>> plans[0]
<Plan 5>
>>> plans[0].title
'Hair Gel'
>>> plans[0].documents
[]
>>> from subscribie.models import Document
>>> documents = Document.query.all()
>>> documents
[<Document 1>, <Document 2>]
>>> documents[0]
<Document 1>
>>> documents[0].name
'Catherine Myers'
>>> plans[0].documents
[]
>>> plans[0].documents.append(documents[0])
>>> plans[0]
<Plan 5>
>>> plans[0].documents
[<Document 1>]
>>> from subscribie.database import database
>>> database.session
<sqlalchemy.orm.scoping.scoped_session object at 0x7f1090fed240>
>>> database.session.commit()

$ exit

Model: Document

Note that Documents have a type so that they may be filtered.
(tags may be added in another issue)

https://github.com/Subscribie/subscribie/blob/1005-terms-and-conditions/subscribie/models.py#L1077-L1091

Model: Plan (updated):

https://github.com/Subscribie/subscribie/blob/1005-terms-and-conditions/subscribie/models.py#L556

Associations: Many to many

https://github.com/Subscribie/subscribie/blob/1005-terms-and-conditions/migrations/versions/429b32b9ad20_add_plan_documents_association.py

@chrisjsimpson chrisjsimpson temporarily deployed to testing November 16, 2022 23:51 Inactive
@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

@chrisjsimpson chrisjsimpson temporarily deployed to testing November 17, 2022 01:21 Inactive
@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

Show documents attached to subscriptions in dashboard/subscribers
@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

@chrisjsimpson chrisjsimpson temporarily deployed to testing November 21, 2022 00:51 Inactive
@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

@chrisjsimpson chrisjsimpson temporarily deployed to testing November 22, 2022 20:18 Inactive
@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

@chrisjsimpson chrisjsimpson temporarily deployed to testing November 22, 2022 20:33 Inactive
@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

@github-actions
Copy link

🙌 Live preview is here: http://1005-terms-and-conditions.pcpink.co.uk

@github-actions
Copy link

🚀 PR was released in v0.1.162 🚀

@github-actions github-actions bot added the released This issue/pull request has been released. label Nov 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant