On Wed, Aug 12, 2009 at 8:03 AM, rekha <jayaprakash.re...@gmail.com> wrote:

>
> Hi all,
> im a newbie, developing online address book application using django,
> mod_python, apache2, postgresql.
>
> i have two tables in my database viz login_table and contact_table..
> login_table stores username and password.. contact table stores first
> name, last name, phone number, email id.. username field in
> login_table is foreignkey to contact_table.. now my application want
> to access all the records from contact_table which corresponds to a
> particular username in the login_table.. but my code gives
> IntegrityError when try to do so.. how to fix this problem?
>

Again, if you want people to help you will likely need to put a little more
effort into providing good information about the problem.  Approx. 200 lines
of code and "IntegrityErorr" as the only clue is unlikely to result in
anyone attempting to dig in and point out where the errors may be.

An IntegrityError comes with a traceback, that pinpoints the line of code
(and the whole history of calls leading to it) that caused the error.
Including the traceback would help people help you.  You should also use it
to narrow the scope of the code you cut-and-paste into your questions.  The
call stack will show which of your routines are involved in triggering the
problem: including bunches of other views that aren't on the code path for
the problem is counterproductive.

It would also help if you got a lot more specific about what exactly you do
to cause the error.  Presumably you are accessing some url that is supposed
to result in a particular view being called.  Name that view, don't expect
people to dig through 200 lines of code to try to find where you are
"access[ing] all the records from contact_table which correspond to a
particular username in the login_table".

Without looking at the code I will say an IntegrityError is not something
you will get from trying to access records, it's an error you would get when
trying to save something to the database.  So I suspect your problem is
somewhere other than where you think it is and has nothing to do with that
particular lookup you mentioned.

Karen

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to