-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add activity foreign key in `Pool` Make the exchange attributes optional Commit migration file * Checks if user participates in required activity * Refactor out active, activity and time checks * Set blank flags on pool item and record attributes Removed the NULL flag because we have a non-null default value. * Check activity status when making frontend dict So if the user didn't take part in the required activity, the pool won't show up in the `showPools` page. * Fix model definitions Use class instead of string when specifying foreign key; add None as default for Pool.activity
- Loading branch information
Showing
3 changed files
with
96 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/migrations/0008_pool_activity_alter_poolitem_exchange_attributes_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 5.0.1 on 2024-08-31 15:14 | ||
|
||
import django.db.models.deletion | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("app", "0007_poolitem_exchange_attributes_poolrecord_attributes"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="pool", | ||
name="activity", | ||
field=models.ForeignKey( | ||
blank=True, | ||
default=None, | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
to="app.activity", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="poolitem", | ||
name="exchange_attributes", | ||
field=models.JSONField(blank=True, default=list, verbose_name="属性"), | ||
), | ||
migrations.AlterField( | ||
model_name="poolrecord", | ||
name="attributes", | ||
field=models.JSONField(blank=True, default=dict, verbose_name="属性"), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters