-
-
Notifications
You must be signed in to change notification settings - Fork 775
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
adds the ability for phantom funding of a grant #5054
Changes from 2 commits
ac6f7dc
33c5e94
ac41d15
c2dafab
81e8513
47a3750
b904a47
61b8037
8121c36
70bb11b
8450dc2
09320f8
2f51e7f
0833579
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Generated by Django 2.2.3 on 2019-08-21 17:25 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import economy.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dashboard', '0048_merge_20190808_1934'), | ||
('grants', '0027_remove_grant_request_ownership_change'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='PhantomFunding', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created_on', models.DateTimeField(db_index=True, default=economy.models.get_time)), | ||
('modified_on', models.DateTimeField(default=economy.models.get_time)), | ||
('round_number', models.PositiveIntegerField(blank=True, null=True)), | ||
('grant', models.ForeignKey(help_text='The associated Phantom Funding.', on_delete=django.db.models.deletion.CASCADE, related_name='phantom_funding', to='grants.Grant')), | ||
('profile', models.ForeignKey(help_text='The associated Phantom Funding.', on_delete=django.db.models.deletion.CASCADE, related_name='grant_phantom_funding', to='dashboard.Profile')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -900,3 +900,25 @@ class MatchPledge(SuperModel): | |
def __str__(self): | ||
"""Return the string representation of this object.""" | ||
return f"{self.profile} <> {self.amount} DAI" | ||
|
||
class PhantomFunding(SuperModel): | ||
"""Define the structure of a subscription agreement.""" | ||
|
||
round_number = models.PositiveIntegerField(blank=True, null=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @frankchen07 this is the new model that will contain info about when people phantom fund. two ways we can manage this:
cc @danlipert 4 other ideas There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In a related conversation, Dan suggested that we do some kind of simplified calculation and cache the results so we can give them a range, since doing a live calculation with real data every time someone changes a number in an input box can be performance hell. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
agree with @danlipert s thoughts. |
||
grant = models.ForeignKey( | ||
'grants.Grant', | ||
related_name='phantom_funding', | ||
on_delete=models.CASCADE, | ||
help_text=_('The associated Phantom Funding.'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change help text to something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
) | ||
|
||
profile = models.ForeignKey( | ||
'dashboard.Profile', | ||
related_name='grant_phantom_funding', | ||
on_delete=models.CASCADE, | ||
help_text=_('The associated Phantom Funding.'), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change help text to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. updated |
||
) | ||
|
||
def __str__(self): | ||
"""Return the string representation of this object.""" | ||
return f"{self.round_number}; {self.profile} <> {self.grant}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add something that describes what this is for or why we created it? Looks like this is from a cut-and-paste job ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated