example : I have two classes, respectively person contact. I want to contact class has , in its attributes , values worked coming from class person , such as name, pass in person , and size of the contact name in the class. I did something like this : from django.db import models
class person ( models.Model ) : qtdade = models.IntegerField (default = 1 ) class Meta : verbose_name_plural = ' Person ' def valor_contato ( self): return self.qtdade * 2 class contact ( models.Model ) : p = Person () value = models.CharField ( max_length = 150, default = p.qtdade ) 2015-07-07 4:08 GMT-03:00 James Schneider <jrschneide...@gmail.com>: > Can you give a simple example or analogy of what you are trying to do? > > -James > On Jul 6, 2015 5:29 PM, "Carlos Andre" <eucan...@gmail.com> wrote: > >> Hello to all , I need to solve a problem. I have two classes of which have >> to use , in the second class, the first coming values. How to do this? >> Thanks for listening! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To post to this group, send email to django-users@googlegroups.com. >> Visit this group at http://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAA8yBMx1B0VAyA4qqCM4SMhYdUAo9Hv_p4yvdMD1d_3R8PbdeA%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAA8yBMx1B0VAyA4qqCM4SMhYdUAo9Hv_p4yvdMD1d_3R8PbdeA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To post to this group, send email to django-users@googlegroups.com. > Visit this group at http://groups.google.com/group/django-users. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXw4A1q69a7THGUqYat5beLd-_CPF1Y8fV2NzyN5UW8gQ%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CA%2Be%2BciXw4A1q69a7THGUqYat5beLd-_CPF1Y8fV2NzyN5UW8gQ%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at http://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAA8yBMyKAqomPsUTFD%2B7tiUFXABSv-zuatkFHktYEhkaKN%2BcpQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.