diff --git a/app/grants/migrations/0025_donation.py b/app/grants/migrations/0025_donation.py deleted file mode 100644 index c6b40d07bfb..00000000000 --- a/app/grants/migrations/0025_donation.py +++ /dev/null @@ -1,39 +0,0 @@ -# Generated by Django 2.1.7 on 2019-07-22 13:10 - -from django.db import migrations, models -import django.db.models.deletion -import economy.models - - -class Migration(migrations.Migration): - - dependencies = [ - ('dashboard', '0041_auto_20190718_1222'), - ('grants', '0024_auto_20190612_1645'), - ] - - operations = [ - migrations.CreateModel( - name='Donation', - 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)), - ('from_address', models.CharField(default='0x0', help_text="The sender's address.", max_length=255)), - ('to_address', models.CharField(default='0x0', help_text='The destination address.', max_length=255)), - ('token_address', models.CharField(default='0x0', help_text='The token address to be used with the Grant.', max_length=255)), - ('token_symbol', models.CharField(default='', help_text="The donation token's symbol.", max_length=255)), - ('token_amount', models.DecimalField(decimal_places=18, default=0, help_text='The donation amount in tokens.', max_digits=64)), - ('token_amount_usdt', models.DecimalField(decimal_places=4, default=0, help_text='The donation amount converted to USDT/DAI at the moment of donation.', max_digits=50)), - ('tx_id', models.CharField(default='0x0', help_text='The transaction ID of the Contribution.', max_length=255)), - ('network', models.CharField(default='mainnet', help_text='The network in which the Subscription resides.', max_length=8)), - ('donation_percentage', models.DecimalField(decimal_places=2, default=0, help_text='The additional percentage selected when the donation is made', max_digits=5)), - ('contribution', models.ForeignKey(help_text='The contribution that this donation was a part of.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donation', to='grants.Contribution')), - ('profile', models.ForeignKey(help_text="The donator's profile.", null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donations', to='dashboard.Profile')), - ('subscription', models.ForeignKey(help_text='The recurring subscription that this donation originated from.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='donations', to='grants.Subscription')), - ], - options={ - 'abstract': False, - }, - ), - ] diff --git a/app/grants/models.py b/app/grants/models.py index f3eb7ca9793..721bd68525e 100644 --- a/app/grants/models.py +++ b/app/grants/models.py @@ -734,94 +734,6 @@ def psave_grant(sender, instance, **kwargs): #print("-", subscription.id, value_usdt, instance.monthly_amount_subscribed ) -class DonationQuerySet(models.QuerySet): - """Define the Contribution default queryset and manager.""" - - pass - - -class Donation(SuperModel): - """Define the structure of an optional donation. These donations are - additional funds sent to Gitcoin as part of contributing or subscribing - to a grant.""" - - from_address = models.CharField( - max_length=255, - default='0x0', - help_text=_("The sender's address."), - ) - to_address = models.CharField( - max_length=255, - default='0x0', - help_text=_("The destination address."), - ) - profile = models.ForeignKey( - 'dashboard.Profile', - related_name='donations', - on_delete=models.SET_NULL, - help_text=_("The donator's profile."), - null=True, - ) - token_address = models.CharField( - max_length=255, - default='0x0', - help_text=_('The token address to be used with the Grant.'), - ) - token_symbol = models.CharField( - max_length=255, - default='', - help_text=_("The donation token's symbol."), - ) - token_amount = models.DecimalField( - default=0, - decimal_places=18, - max_digits=64, - help_text=_('The donation amount in tokens.'), - ) - token_amount_usdt = models.DecimalField( - default=0, - decimal_places=4, - max_digits=50, - help_text=_('The donation amount converted to USDT/DAI at the moment of donation.'), - ) - tx_id = models.CharField( - max_length=255, - default='0x0', - help_text=_('The transaction ID of the Contribution.'), - ) - network = models.CharField( - max_length=8, - default='mainnet', - help_text=_('The network in which the Subscription resides.'), - ) - donation_percentage = models.DecimalField( - default=0, - decimal_places=2, - max_digits=5, - help_text=_('The additional percentage selected when the donation is made'), - ) - subscription = models.ForeignKey( - 'grants.subscription', - related_name='donations', - on_delete=models.SET_NULL, - help_text=_("The recurring subscription that this donation originated from."), - null=True, - ) - contribution = models.ForeignKey( - 'grants.contribution', - related_name='donation', - on_delete=models.SET_NULL, - help_text=_("The contribution that this donation was a part of."), - null=True, - ) - - - def __str__(self): - """Return the string representation of this object.""" - from django.contrib.humanize.templatetags.humanize import naturaltime - return f"id: {self.pk}; from:{profile.handle}; {tx_id} => ${token_amount_usdt}; {naturaltime(self.created_on)}" - - class ContributionQuerySet(models.QuerySet): """Define the Contribution default queryset and manager."""