soniiic wrote:

On Mar 31, 10:31 pm, Mitko Masarliev <m.masarl...@gmail.com> wrote:
  
I have application with table name clients. Clients has one to one
relation with django users and in all app logic I check clients id by
request.user.id, In some cases user_id is not same as clients_id. This
is the problem, so I am trying to change request.user.id to be equal to
clients_id and this will halp me rewriting many classes and methods
    

if you got a one to one relationship why can't you just do this:
client = Clients.objects.filter(user=request.user)

...where user is your relationship field in the Client model.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---


  
Becouse I have other table with relation to clients I and these tables don't have relation with users

--

Regards,
Mitko Masarliev
Junior Php Developer
m.masarl...@viscomp.bg
Mobile: +359 898 563 274

Viscomp EOOD
92V "Hristo Botev" Blvd
4000 Plovdiv
Bulgaria

Tel: +359 32 655 175
Fax: +359 32 655 176
www.viscomp.bg

Reply via email to