Hi all,

Suppose I have these data:

class Name(models.Model):
    nameId = models.AutoField(primary_key=True)
    name = models.CharField(max_length=20)
    nameAddress = models.CharField(max_length=50)

on my views.py:
def name_delete(request, object_id):
    conn = psycopg2.connect("dbname=mydb user=postgres password=sa
host=localhost")
    cur = conn.cursor()
    sql = "delete from name where nameId = '%s'"% (object_id)
    cur.execute(sql)
    conn.commit()
    conn.close()
    return HttpResponseRedirect("/Mylist")

it seems that object_id got the nameid field instead of the nameId
camelcase column. is it true for all?
I got this everytime I try to delete a row on my list:

ProgrammingError at /deletename/

column "name_id" does not exist
LINE 1: ...DELETE from name ' WHERE name_Id='1'
---------------------

Thanks!

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