opefitoo / inur.django

django backend / frontend of the inur app
GNU General Public License v2.0
2 stars 3 forks source link

158 some fields are not mandatory but still theyre very important #162

Closed aamadou closed 10 months ago

mehditerraneen commented 1 year ago

please merge on develop branch before, and we need to fix tests otherwise pr merge feature is disabled

mehditerraneen commented 1 year ago

why loop through important_fields never heard of that, I would just do something like this:

class Configuration:
    def __init__(self, models: List[Tuple[Model, List[str]]]):
        self.models = models`

    def run_checks(self):
        for model, fields in self.models:
            for obj in model.objects.all():
                for field in fields:
                    value = getattr(obj, field)
                    # Perform checks on the value
                    # ...