0
I am studying python and would like to understand how I can define an attribute of a class based on attributes of another class.
I’ll go to the example to be clearer, it’s just an example of what I need for my small application Jango, where in the register of a person, I will set her position based on job registrations.
{class Pessoa(models.Model):
nome = models.CharField(max_length=20, null=False)
cargo = ##abrir opções de Cargos cadastrados em "Cargos"
class Cargos(models.Model):
nome_cargo = models.CharField(max_length=20, null=False)}
Here is an explanation of Django’s relationships: Relationships from DJANGO Table
– Rodolfo Sousa
You want a class in another class?
– Maury Developer
@Maurydeveloper hi, I managed to resolve, actually it was a relationship, I answered the question because I could understand here, Thank you
– Rodolfo Sousa