divanov11 / mumbleapi

Backend/API for the Mumble.dev, an open source social media application.
Apache License 2.0
200 stars 122 forks source link

Refactoring models to follow DRY principle #181

Open sulavmhrzn opened 3 years ago

sulavmhrzn commented 3 years ago

Is your feature request related to a problem? Please describe.

No, i just saw different model class having the same attribute

created = models.DateTimeFied(...)

#

Describe the solution you'd like

Can't we move the similar attribute in this case

created = models.DateTimeField(...)

to a separate class and make other class that needs created to inherit from the class? #

Describe alternatives you've considered

class DateTimeModel(models.Model):
    created = models.DateTimeField(...)

    class Meta:
        abstract = True

class AnotherModel(DateTimeModel):
    ...
fredychivalan commented 3 years ago

how can I take this issue, I want to collaborate.

PraveenMalethia commented 3 years ago

Thank you for your suggestion @sulavmhrzn , i will assign this to you soon @FredyChivalan .

Azeezdot123 commented 3 years ago

@PraveenMalethia if this is not started I can pick this up. Thanks!

Azeezdot123 commented 3 years ago

@PraveenMalethia pls assign this to me.