Skip to content

Commit

Permalink
update api info
Browse files Browse the repository at this point in the history
  • Loading branch information
guoshijiang committed Mar 17, 2024
1 parent fd68595 commit b830b24
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 4 deletions.
2 changes: 1 addition & 1 deletion airdrop/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ class ChainAdmin(admin.ModelAdmin):

@admin.register(PeriodReward)
class ChainAdmin(admin.ModelAdmin):
list_display = ('id', 'name', 'address', 'amount', 'is_send')
list_display = ('id', 'title', 'address', 'amount', 'is_send')
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.1.1 on 2024-03-17 09:12

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('airdrop', '0004_periodreward'),
]

operations = [
migrations.RemoveField(
model_name='periodreward',
name='name',
),
migrations.AddField(
model_name='periodreward',
name='period',
field=models.CharField(blank=True, max_length=300, verbose_name='活动周期'),
),
migrations.AddField(
model_name='periodreward',
name='sub_title',
field=models.CharField(default='', max_length=200, verbose_name='活动副标题'),
),
migrations.AddField(
model_name='periodreward',
name='title',
field=models.CharField(default='', max_length=200, verbose_name='活动主题'),
),
]
25 changes: 22 additions & 3 deletions airdrop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def as_dict(self):
'id': self.id,
'name': self.address,
'type': self.type,
'points': self.points
'points': self.points,
'created_at': self.created_at
}


Expand Down Expand Up @@ -262,10 +263,19 @@ def as_dict(self):


class PeriodReward(BaseModel):
name = models.CharField(
title = models.CharField(
max_length=200,
unique=False,
blank=False,
default="",
verbose_name='活动主题'
)
sub_title = models.CharField(
max_length=200,
unique=False,
verbose_name='中奖期数'
blank=False,
default="",
verbose_name='活动副标题'
)
address = models.CharField(
max_length=200,
Expand All @@ -277,6 +287,12 @@ class PeriodReward(BaseModel):
unique=False,
verbose_name='中奖金额'
)
period = models.CharField(
max_length=300,
unique=False,
blank=True,
verbose_name='活动周期'
)
is_send = models.BooleanField(
default=False
)
Expand All @@ -291,7 +307,10 @@ def __str__(self):
def as_dict(self):
return {
'id': self.id,
'title': self.title,
'sub_title': self.sub_title,
'address': self.address,
'period': self.period,
'amount': self.amount,
'is_send': self.is_send,
}

0 comments on commit b830b24

Please sign in to comment.