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

Extract grants models into individual files #9341

Conversation

jeremyschuurmans
Copy link
Contributor

@jeremyschuurmans jeremyschuurmans commented Aug 5, 2021

Description

In order to unit test each model in app/grants/models.py, it will be helpful to have each model in its own file rather than one big file.

Once this work is complete, unit tests can be added to each model in smaller PRs.

Wins for implementing this structure include:

  • Models code is more readable and easier to navigate
  • Reduces the possibility of models becoming overly coupled
  • Smaller files reduces the possibility of bugs being introduced
Refers/Fixes
Testing

This work is preparatory to writing unit tests for each of the grants models

@jeremyschuurmans jeremyschuurmans force-pushed the extract-grants-models-into-individual-files branch from ce50e32 to c12fa43 Compare August 16, 2021 15:51
gdixon pushed a commit that referenced this pull request Sep 27, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* remove original models.py

* resolve eslint error breaking CI build
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 27, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 28, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
thelostone-mc pushed a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add test directory for models and directory for factories

* add initial test for donation model

* add test case for from_address

* test donation has a to_address

* add test case for relation to profile

* add test case for token_address

* add test case for donation.token_symbol

* add test case for donation.token_amount

* add test case for donation.token_amount_usdt

* add test case for donation.tx_id

* add test case for donation.network

* add test cases for donation_percentage and subscription

* add test case for relation to contribution

* remove some whitespace

* refactor and add docstrings

* refactor

* refactor
thelostone-mc added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add directories for tests and factories

* add initial test for CartActivity

* add test case for relation to Grant

* add test case for relation to Profile

* add test case for 'action' attribute

* add test case for 'metadata' attribute

* add test case for 'bulk' attribute

* add test case for 'latest' attribute

* add pytest

* add tests for CartActivity, add factory for CartActivity and Profile

* add test case for 'latest' attribute

* add test for relationship to Grant

* add factory for Profile

* refactor

* refactor

* refactor

* add assertions

* refactor

* refactor

* fix duplicate dependency

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
thelostone-mc added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add initial test for CLRMatch

* add unit test for 'round_number'

* add test case for 'amount' attribute

* test CLRMatch has associated grant

* add test case for has_passed_kyc attr

* add test case for 'ready_for_test_payout' attr

* add test case for test_payout_tx

* add test case for test_payout_tx_date

* add test case for test_payout_contribution

* add test case for 'ready_for_payout'

* add test case for payout_tx

* add test case for payout_tx_date

* refactor and add test case for payout_contribution

* add test case for comments

* refactor

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
thelostone-mc added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add directory structure for models testing and factories

* add initial test

* stub out test cases

* add docstrings and factories

* add assertions for policy_name attribute

* add assertions for url_pattern

* refactor and add assertions for banner_image

* add assertions for priority, background_image, inline_css

* fix typo

* refactor

* Update grant.py

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
thelostone-mc added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy to requirements

* add models and factories directories

* add initial test

* test association with Grant

* test data attribute

* add test case for snapshot_type

* refactor

* Update grant.py

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
thelostone-mc added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add directories

* add initial test case

* add test case for 'latest' attribute

* add test case for associated Grant

* add test case for associated GrantCLR

* add test case for 'clr_prediction_curve'

* refactor

* Update grant.py

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
jeremyschuurmans pushed a commit to jeremyschuurmans/web that referenced this pull request Sep 29, 2021
* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from gitcoinco#9314

* add try/except to migration file instead of editing migration directly

* refactor
thelostone-mc pushed a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy and directories

* add factory and initial test case

* add test case for 'category' attribute

* refactor

* add missing checkout_type (present in migration but not in model)
thelostone-mc pushed a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add initial test case

* add test case for associated Grant

* add test case for associated Profile

* add test case for comments

* add test case for processed attribute

* add test case for comments_admin

* add test case for tweet

* add test case for post_flag() method

* refactor test for post_flag() method

* refactor

* add missing checkout_type (present in migration but not in model)
gdixon added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add directories and test files

* add initial test

* add test for company_name

* fix typo

* add test for round_num

* add test for sub_round_slug

* add tests for display_text and owner

* add test case for owner attribute

* add test for is_active attribute

* add test for start_date

* add test for end_date

* add test for grant_filters

* add test for subscription_filters

* add test for collection_filters

* add test for verified_threshold

* add test for unverified_threshold

* add test for total_pot

* add test for contribution_multiplier

* add test for logo

* add test for happening_now

* add test for happening_now returning false

* fix typo

* add tests for happened_recently

* add test for record_clr_prediction_curve

* add test for grants method

* add test case for grants method

* add test case for grants method

* add test case for grants method

* add test case for grants method

Co-authored-by: Graham Dixon <graham@gitcoin.co>
gdixon added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add directories and test files

* add initial test

* add test for grants

* add test for profile

* add test for title

* add test for description

* add test for cover

* add test for hidden attribute

* add test for cache

* add test for featured

* add test for shuffle_rank

* add test for curators

* refactor

Co-authored-by: Graham Dixon <graham@gitcoin.co>
gdixon pushed a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* create directories and test files

* add initial test case

* fix typo

* add test for key

* add test for secret attribute

* add test for profile

* refactor

* refactor
gdixon added a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy

* add initial test

* add test case for 'active' attribute

* add test for profile attribute

* add test case for 'amount'

* add test for pledge_type attribute

* add test case for comments

* refactor

* add test case for 'end_date' attribute

* add test case for 'data' attribute

* add test case for 'clr_round_num'

* add test case for data_json property

* remove unnecessary import

* refactor

Co-authored-by: Aditya Anand M C <aditya.anandmc@gmail.com>
Co-authored-by: Graham Dixon <graham@gitcoin.co>
gdixon pushed a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* add pytest-factoryboy to requirements

* add test directory

* add initial test case

* add test case for 'name'

* test 'label' attribute

* test 'is_active' attribute

* add test case for 'is_visible' attribute

* run one test instead of entire test suite

* add test case for relation to GrantCategory

* test 'logo' attribute

* add initial test for clrs method

* add initial test for active_clrs method

* add test for active_clrs_sum method

* add docstrings

* refactor

* refactor

* refactor

* refactor

* refactor

* fix failing test
thelostone-mc pushed a commit that referenced this pull request Sep 29, 2021
* Extract grants models into individual files (#9341)

* create new directory for models, copy over Contribution model

* extract grants models to individual files

* rename relocated_models directory, remove original models directory, add imports, resolve circular dependencies

* extract CLRMatch into separate file

* extract Flag into separate file

* extract MatchPledge to separate file

* extract Donation and PhantomFunding

* extract GrantStat into separate file

* refactor

* extract GrantBrandingRoutingPolicy to separate file

* update migration

* add missing import to MatchPledge, remove imports from __init__.py

* add missing import

* decouple GrantCLRCalculation and move to own file

* extract GrantType to own file

* extract GrantCLR to own file

* add missing import

* refactor, add missing imports

* remove whitespace

* resolve circular dependency

* run 'make fix'

* import changes from #9314

* add try/except to migration file instead of editing migration directly

* refactor

* remove PhantomFunding model

* remove imports and calls to PhantomFunding

* remove references to PhantomFunding in scripts/debug/address_usage_finder.py

* run migration deleting PhantomFunding model

* replace GrantCategory with GrantTag in admin.py

* resolve conflict resulting in CI failure
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.

6 participants