Thanks for your reply, I'm thinking and working outloud on
the answers that follow, I've a solution sort of but remain mystified
as to why and how it works.

> How are you deciding it's not working?

via pgAdminIII where I can see the sequence table
being incremented + 1 on every django save but
no rows added to table mytable

>Are you seeing errors?

No errors on the surface it looks like it working but
no rows are being added.

I can refresh and reboot and still see no rows being
added to Table mytable, even though Sequences id table
gets incremented.

I've also added an
assert False, p1.id
to the routine in question, and can see it is adding an id to the
sequence table as corroborated in the
p1.id resulting from p1.save()...

>>>Does the object have a pk assigned after you call save()?  

Yes it has a pk assigned after the save reflecting it is infact
incrementing ids.

>>>If yes, have you tried > adding code after the save() to retrieve the object 
>>>by pk?

p2 = mytable.objects.get(id=p1.id)

Returns the object as if it is saved by I see nothing in the table,
python command line though issued from the same folder,
using the same settings does though add a row.

>Are you perhaps  querying for the save() working using a >transaction that is 
>isolated?

I'm not sure if I completely understand this question this
though is an -- isolated function defined as "testit" in views
pointed to by url.py. There is no code before or after this
sample, it is not nested.

I'm sorry I don't understand exactly what you are saying in this
question...this code though has been stripped down to as basic
as possible to though to determine why django does not
save when python command line saves to the table.

> This is very basic fundamental function, it is unlikely to be badly broken.  
> It's far more likely that what you are doing to check that it is working is 
> what is broken.

I hear what you are saying, pgAdminIII though has been accurate for
all other functions regarding seeing what is in the database via
django and python over the last 5 months, including ; additions to
registration table and profile entries, adding tables via manage.py
and about ever other function I can imagine.

I'm baffled why my own attempts to add data to the tables is not
working and/or why is the data saved via save() in django is
disappearing when save() in python shell save() works every time.

Now get this -- if I add a 'return' to the end of the function it adds
the rows -- why is this?

If I insert an assert False the functions sort of behave like they are
working returning an object for the new pk id but incrementing the seq
tables, but not loading the data into postgresql.

any idea why this is?



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