same field in two classes

8 views
Skip to first unread message

Giovanny Vizcaya

unread,
Aug 2, 2015, 1:15:47 PM8/2/15
to Django users
Good day,i'm new in django and i'm doing a project, i have a class "Employee" with atribute "salary", same time i have class "Payroll" with atribute "salary", how can i take the value of employee salary to payroll salary? thank you in advance for answers

Alex Heyden

unread,
Aug 2, 2015, 2:09:37 PM8/2/15
to django...@googlegroups.com
Sorry, I think there might be a bit of a language barrier. What do you mean by "take the value of employee salary to payroll salary?"

On Sun, Aug 2, 2015 at 12:12 PM, Giovanny Vizcaya <gio.viz...@gmail.com> wrote:
Good day,i'm new in django and i'm doing a project, i have a class "Employee" with atribute "salary", same time i have class "Payroll" with atribute "salary", how can i take the value of employee salary to payroll salary? thank you in advance for answers

--
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...@googlegroups.com.
To post to this group, send email to django...@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/5a479e43-4612-4b2e-92be-638b5eec9124%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Robin Lery

unread,
Aug 2, 2015, 6:55:03 PM8/2/15
to django...@googlegroups.com

You can use inheritance. Or content type. Or use signals to get the value of salary from one model and save it to another model.

Javier Guerra Giraldez

unread,
Aug 3, 2015, 3:02:51 AM8/3/15
to django...@googlegroups.com
On Sun, Aug 2, 2015 at 5:54 PM, Robin Lery <robi...@gmail.com> wrote:
> You can use inheritance. Or content type. Or use signals to get the value of
> salary from one model and save it to another model.


or choose the right place to store it and don't duplicate information.


--
Javier
Reply all
Reply to author
Forward
0 new messages