django_seed/seeder.py
def guess_field_formatters(self, faker):
        """
        Gets the formatter methods for each field using the guessers
        or related object fields
        :param faker: Faker factory object
        """
        formatters = {}
        name_guesser = NameGuesser(faker)
        field_type_guesser = FieldTypeGuesser(faker)

        for field in self.model._meta.fields:

            field_name = field.name

            if field.primary_key:
                continue

            if field.get_default():
                formatters[field_name] = field.get_default()
                continue

            if isinstance(field, (ForeignKey, ManyToManyField, OneToOneField)):
                formatters[field_name] = self.build_relation(field, field.related_model)
                continue

            if not field.choices:
                formatter = name_guesser.guess_format(field_name)
                if formatter:
                    formatters[field_name] = formatter
                    continue

            formatter = field_type_guesser.guess_format(field)
            if formatter:
                formatters[field_name] = formatter
                continue

        return formatters

        Gets the formatter methods for each field using the guessers
        or related object fields
        :param faker: Faker factory object
        
Gets the formatter methods for each field using the guessers
or related object fields
Gets the formatter methods for each field using the guessers or related object fields
def guess_field_formatters(self, faker):
        formatters = {}
        name_guesser = NameGuesser(faker)
        field_type_guesser = FieldTypeGuesser(faker)
        for field in self.model._meta.fields:
            field_name = field.name
            if field.primary_key:
                continue
            if field.get_default():
                formatters[field_name] = field.get_default()
                continue
            if isinstance(field, (ForeignKey, ManyToManyField, OneToOneField)):
                formatters[field_name] = self.build_relation(field, field.related_model)
                continue
            if not field.choices:
                formatter = name_guesser.guess_format(field_name)
                if formatter:
                    formatters[field_name] = formatter
                    continue
            formatter = field_type_guesser.guess_format(field)
            if formatter:
                formatters[field_name] = formatter
                continue
        return formatters
def guess_field_formatters ( self , faker ) : formatters = { } name_guesser = NameGuesser ( faker ) field_type_guesser = FieldTypeGuesser ( faker ) for field in self . model . _meta . fields : field_name = field . name if field . primary_key : continue if field . get_default ( ) : formatters [ field_name ] = field . get_default ( ) continue if isinstance ( field , ( ForeignKey , ManyToManyField , OneToOneField ) ) : formatters [ field_name ] = self . build_relation ( field , field . related_model ) continue if not field . choices : formatter = name_guesser . guess_format ( field_name ) if formatter : formatters [ field_name ] = formatter continue formatter = field_type_guesser . guess_format ( field ) if formatter : formatters [ field_name ] = formatter continue return formatters
Gets the formatter methods for each field using the guessers
or related object fields
Gets the formatter methods for each field using the guessers or related object fields
"""
        Gets the formatter methods for each field using the guessers
        or related object fields
        :param faker: Faker factory object
        """
self
faker
Faker factory object
Faker factory object