Skip to content

Commit

Permalink
Merge pull request #1458 from gtech-mulearn/dev
Browse files Browse the repository at this point in the history
[MINOR] Patch in dev
  • Loading branch information
MZaFaRM authored Oct 29, 2023
2 parents 7b0ebee + 5cf3d5e commit 6e31d35
Show file tree
Hide file tree
Showing 9 changed files with 90 additions and 95 deletions.
2 changes: 1 addition & 1 deletion api/dashboard/task/dash_task_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get(self, request):
task_queryset = TaskList.objects.select_related(
"created_by",
"updated_by",
"channels",
"channel",
"type",
"level",
"ig",
Expand Down
1 change: 1 addition & 0 deletions db/hackathon.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from db.user import User

# fmt: off
# noinspection PyPep8

class Hackathon(models.Model):
id = models.CharField(primary_key=True, max_length=36)
Expand Down
2 changes: 2 additions & 0 deletions db/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from django.db import models

from db.user import User

# fmt: off
# noinspection PyPep8

class Integration(models.Model):
id = models.CharField(primary_key=True, default=uuid.uuid4, max_length=36)
Expand Down
4 changes: 3 additions & 1 deletion db/learning_circle.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

from db.task import InterestGroup, Organization
from db.user import User

# fmt: off
# noinspection PyPep8

class LearningCircle(models.Model):
id = models.CharField(primary_key=True, max_length=36)
Expand Down Expand Up @@ -36,4 +38,4 @@ class UserCircleLink(models.Model):

class Meta:
managed = False
db_table = "user_circle_link"
db_table = "user_circle_link"
4 changes: 3 additions & 1 deletion db/notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from django.db import models

from db.user import User

# fmt: off
# noinspection PyPep8

class Notification(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
Expand All @@ -18,4 +20,4 @@ class Notification(models.Model):
class Meta:
managed = False
db_table = "notification"
ordering = ["created_at"]
ordering = ["created_at"]
2 changes: 2 additions & 0 deletions db/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
from django.db import models

from .user import User

# fmt: off
# noinspection PyPep8

class Country(models.Model):
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
Expand Down
4 changes: 2 additions & 2 deletions db/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .user import User

# fmt: off

# noinspection PyPep8

class Channel(models.Model):
id = models.CharField(primary_key=True, max_length=36)
Expand Down Expand Up @@ -222,4 +222,4 @@ class VoucherLog(models.Model):

class Meta:
managed = False
db_table = "voucher_log"
db_table = "voucher_log"
1 change: 1 addition & 0 deletions db/url_shortener.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from db.user import User

# fmt: off
# noinspection PyPep8

class UrlShortener(models.Model):
id = models.CharField(primary_key=True, max_length=36)
Expand Down
165 changes: 75 additions & 90 deletions db/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@

from django.db import models


# fmt: off
# noinspection PyPep8

class User(models.Model):
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
discord_id = models.CharField(unique=True, max_length=36, blank=True, null=True)
muid = models.CharField(unique=True, max_length=100)
first_name = models.CharField(max_length=75)
last_name = models.CharField(max_length=75, blank=True, null=True)
email = models.EmailField(unique=True, max_length=200)
password = models.CharField(max_length=200, blank=True, null=True)
mobile = models.CharField(unique=True, max_length=15)
district = models.ForeignKey("district", models.DO_NOTHING, blank=True, null=True)
gender = models.CharField(max_length=10, blank=True, null=True, choices=[("Male", "Male"), ("Female", "Female")])
dob = models.DateField(blank=True, null=True)
admin = models.BooleanField(default=False)
active = models.BooleanField(default=True)
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
discord_id = models.CharField(unique=True, max_length=36, blank=True, null=True)
muid = models.CharField(unique=True, max_length=100)
first_name = models.CharField(max_length=75)
last_name = models.CharField(max_length=75, blank=True, null=True)
email = models.EmailField(unique=True, max_length=200)
password = models.CharField(max_length=200, blank=True, null=True)
mobile = models.CharField(unique=True, max_length=15)
gender = models.CharField(max_length=10, blank=True, null=True, choices=[("Male", "Male"),("Female", "Female")])
dob = models.DateField(blank=True, null=True)
admin = models.BooleanField(default=False)
active = models.BooleanField(default=True)
exist_in_guild = models.BooleanField(default=False)
profile_pic = models.CharField(max_length=200, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)
profile_pic = models.CharField(max_length=200, blank=True, null=True)
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
Expand All @@ -36,129 +35,115 @@ def fullname(self):


class UserReferralLink(models.Model):
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_user')
referral = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_referral')
is_coin = models.BooleanField(default=False)
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_updated_by',
db_column='updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_created_by',
db_column='created_by')
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_user')
referral = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_referral')
is_coin = models.BooleanField(default=False)
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_updated_by', db_column='updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_referral_link_created_by', db_column='created_by')
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
db_table = 'user_referral_link'


class Role(models.Model):
id = models.CharField(primary_key=True, max_length=36)
title = models.CharField(max_length=75)
description = models.CharField(max_length=300, blank=True, null=True)
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by',
related_name='role_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by',
related_name='role_created_by')
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36)
title = models.CharField(max_length=75)
description = models.CharField(max_length=300, blank=True, null=True)
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by', related_name='role_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by', related_name='role_created_by')
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
db_table = 'role'


class UserRoleLink(models.Model):
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_role_link_user')
role = models.ForeignKey(Role, on_delete=models.CASCADE)
verified = models.BooleanField(default=False)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by',
related_name='user_role_link_created_by')
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user_role_link_user')
role = models.ForeignKey(Role, on_delete=models.CASCADE)
verified = models.BooleanField(default=False)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by', related_name='user_role_link_created_by')
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
db_table = 'user_role_link'


class Socials(models.Model):
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE)
github = models.CharField(max_length=60, blank=True, null=True)
facebook = models.CharField(max_length=60, blank=True, null=True)
instagram = models.CharField(max_length=60, blank=True, null=True)
linkedin = models.CharField(max_length=60, blank=True, null=True)
dribble = models.CharField(max_length=60, blank=True, null=True)
behance = models.CharField(max_length=60, blank=True, null=True)
stackoverflow = models.CharField(max_length=60, blank=True, null=True)
medium = models.CharField(max_length=60, blank=True, null=True)
hackerrank = models.CharField(max_length=60, blank=True, null=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by',
related_name='socials_created_by')
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by',
related_name='socials_updated_by')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(blank=True, null=True, auto_now=True)
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.ForeignKey(User, on_delete=models.CASCADE)
github = models.CharField(max_length=60, blank=True, null=True)
facebook = models.CharField(max_length=60, blank=True, null=True)
instagram = models.CharField(max_length=60, blank=True, null=True)
linkedin = models.CharField(max_length=60, blank=True, null=True)
dribble = models.CharField(max_length=60, blank=True, null=True)
behance = models.CharField(max_length=60, blank=True, null=True)
stackoverflow = models.CharField(max_length=60, blank=True, null=True)
medium = models.CharField(max_length=60, blank=True, null=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by', related_name='socials_created_by')
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by', related_name='socials_updated_by')
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(blank=True, null=True, auto_now=True)

class Meta:
managed = False
db_table = 'socials'


class ForgotPassword(models.Model):
id = models.CharField(primary_key=True, max_length=36)
user = models.ForeignKey(User, on_delete=models.CASCADE)
expiry = models.DateTimeField()
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36)
user = models.ForeignKey(User, on_delete=models.CASCADE)
expiry = models.DateTimeField()
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
db_table = 'forgot_password'


class UserSettings(models.Model):
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="user_settings_user")
is_public = models.BooleanField(default=False)
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by',
related_name='user_settings_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by',
related_name='user_settings_created_by')
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36, default=uuid.uuid4)
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="user_settings_user")
is_public = models.BooleanField(default=False)
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by', related_name='user_settings_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by', related_name='user_settings_created_by')
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
db_table = 'user_settings'


class DynamicRole(models.Model):
id = models.CharField(primary_key=True, max_length=36)
type = models.CharField(max_length=50)
role = models.ForeignKey(Role, on_delete=models.CASCADE, db_column='role', related_name='dynamic_role_role')
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by',
related_name='dynamic_role_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by',
related_name='dynamic_role_created_by')
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36)
type = models.CharField(max_length=50)
role = models.ForeignKey(Role, on_delete=models.CASCADE, db_column='role', related_name='dynamic_role_role')
updated_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='updated_by', related_name='dynamic_role_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey(User, on_delete=models.CASCADE, db_column='created_by', related_name='dynamic_role_created_by')
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
db_table = 'dynamic_role'


class DynamicUser(models.Model):
id = models.CharField(primary_key=True, max_length=36)
type = models.CharField(max_length=50)
user = models.ForeignKey('User', on_delete=models.CASCADE, related_name='dynamic_user_user')
updated_by = models.ForeignKey('User', on_delete=models.CASCADE, db_column='updated_by',
related_name='dynamic_user_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey('User', on_delete=models.CASCADE, db_column='created_by',
related_name='dynamic_user_created_by')
created_at = models.DateTimeField(auto_now_add=True)
id = models.CharField(primary_key=True, max_length=36)
type = models.CharField(max_length=50)
user = models.ForeignKey('User', on_delete=models.CASCADE, related_name='dynamic_user_user')
updated_by = models.ForeignKey('User', on_delete=models.CASCADE, db_column='updated_by', related_name='dynamic_user_updated_by')
updated_at = models.DateTimeField(auto_now=True)
created_by = models.ForeignKey('User', on_delete=models.CASCADE, db_column='created_by', related_name='dynamic_user_created_by')
created_at = models.DateTimeField(auto_now_add=True)

class Meta:
managed = False
Expand Down

0 comments on commit 6e31d35

Please sign in to comment.