Here is the stack trace:

------------------------------------------------------------------------ 
---
psycopg.ProgrammingError                          Traceback (most  
recent call last)

/home/django_dev/pennysaver/<ipython console>

/home/django_dev/pennysaver/addocs/processworkflows.py in  
start_check_workflows(debug)
     137             for i in wflow[1].split(".")[1:]:
     138                 mod = getattr(mod, i)
     139             function = getattr(mod, wflow[2])
--> 140             function(dds_file)
     141

/home/django_dev/pennysaver/addocs/workflows.py in handle_layout 
(dds_xml_file)
     150         return
     151
--> 152     addoc, addocid = copy_to_db('Layout', dds_xml_file, ad, 2)
     153     docname,docext = os.path.splitext(addoc)
     154     copy_to_art(addoc, 'layouts', '%s.%s' % (addocid, docext))

/home/django_dev/pennysaver/addocs/workflows.py in copy_to_db 
(workflow, dds_xml_file, the_ad, doct ype)
     120         (the_ad.ordernumber, doctype, doc.id, docext)
     121     )
--> 122     doc.save()
     123     return (dst_path, doc.id)
     124

/usr/lib/python2.4/site-packages/django/db/models/base.py in save(self)
     182                         ','.join(['%s=%%s' %  
backend.quote_name(f.column) for f in non_pks ]),
     183                         backend.quote_name 
(self._meta.pk.column)),
--> 184                         db_values + [pk_val])
     185             else:
     186                 record_exists = False

/usr/lib/python2.4/site-packages/django/db/backends/util.py in execute 
(self, sql, params)
      10         start = time()
      11         try:
---> 12             return self.cursor.execute(sql, params)
      13         finally:
      14             stop = time()

ProgrammingError: ERROR:  syntax error at or near "_2_8" at character  
118

UPDATE "addocs_document" SET  
"doctype"=2,"ad_id"='123456',"height"=0,"width"=0,"image"=ad_document  
s/2006/10/12/123456_2_8..pdf,"submitted"='2006-10-12  
12:43:24',"received"='2006-10-12 12:57:12.155 598' WHERE "id"=8


As you can see in the UPDATE statement, it is relative to the   
MEDIA_ROOT folder, and it is not quoted. (I don't know why it has two  
periods, but that's my bug)

Thanks for any help,

Corey


On Oct 12, 2006, at 3:12 PM, RajeshD wrote:

>
>> The sve() method gives an error tracing back to the UPDATE statement.
>
> Usually it helps get you better responses, if you include the actual
> stack trace.
>
>> In the statement the 'image' field looks like
>> "image"=/path/to/the/file.ext, ...
>>
>> What is the proper method to set this field?
>
> The ImageField's value is a string with the path of the image file
> relative to your settings.MEDIA_ROOT. It is not the absolute path of
> the image file.
>
> You can easily check this by uploading an image through this field  
> from
> the Admin screen and then checking what the field contains for that
> image.
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to