generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
161 additions
and
3 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
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
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
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
5 changes: 5 additions & 0 deletions
5
app/core/initial_data/PD_ Table and field explanations - UserStatus - Data.csv
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,5 @@ | ||
id,name,description | ||
1,Inactive,Member who has not checked into their project or Community of Practice for 4 weeks and does not have a timeAwayHold | ||
2,Active,Member that is checking into meetings | ||
3,Time Away Hold,Hold placed by the member or their leader after they have announced a temporary absence | ||
4,Barred,Member who has been removed from the community |
52 changes: 52 additions & 0 deletions
52
app/core/migrations/0031_userstatustype_user_user_status.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,52 @@ | ||
# Generated by Django 4.2.11 on 2024-10-31 16:06 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("core", "0030_urltype"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="UserStatusType", | ||
fields=[ | ||
( | ||
"uuid", | ||
models.UUIDField( | ||
default=uuid.uuid4, | ||
editable=False, | ||
primary_key=True, | ||
serialize=False, | ||
unique=True, | ||
), | ||
), | ||
( | ||
"created_at", | ||
models.DateTimeField(auto_now_add=True, verbose_name="Created at"), | ||
), | ||
( | ||
"updated_at", | ||
models.DateTimeField(auto_now=True, verbose_name="Updated at"), | ||
), | ||
("name", models.CharField(max_length=255)), | ||
("description", models.TextField(blank=True)), | ||
], | ||
options={ | ||
"abstract": False, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name="user", | ||
name="user_status", | ||
field=models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="core.userstatustype", | ||
), | ||
), | ||
] |
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 |
---|---|---|
@@ -1 +1 @@ | ||
0030_urltype | ||
0031_userstatustype_user_user_status |
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
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
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
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
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,32 @@ | ||
from django.db import migrations | ||
|
||
from core.models import UserStatusType | ||
|
||
|
||
def forward(__code__, __reverse_code__): | ||
items = [ | ||
( | ||
1, | ||
"Inactive", | ||
"Member who has not checked into their project or Community of Practice for 4 weeks and does not have a timeAwayHold", | ||
), | ||
(2, "Active", "Member that is checking into meetings"), | ||
( | ||
3, | ||
"Time Away Hold", | ||
"Hold placed by the member or their leader after they have announced a temporary absence", | ||
), | ||
(4, "Barred", "Member who has been removed from the community"), | ||
] | ||
for uuid, name, description in items: | ||
UserStatusType.objects.create(uuid=uuid, name=name, description=description) | ||
|
||
|
||
def reverse(__code__, __reverse_code__): | ||
UserStatusType.objects.all().delete() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [("data", "0007_urltype_seed")] | ||
|
||
operations = [migrations.RunPython(forward, reverse)] |
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 |
---|---|---|
@@ -1 +1 @@ | ||
0007_urltype_seed | ||
0008_userstatustype_seed |