Hey,

I've been working on this view for a while and I keep hitting road
blocks,
the newest one actually hits the save method in my view, but stops on
a weird syntax error.
This is the traceback.

Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py"
in get_response
  74. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.4/site-packages/django/contrib/auth/
decorators.py" in _checklogin
  14. return view_func(request, *args, **kwargs)
File "/opt/vidars/cns/vidars/views/pro.py" in bulk_reg
  100. fi.save()
File "/usr/lib/python2.4/site-packages/django/db/models/base.py" in
save
  204. ','.join(placeholders)), db_values)
File "/usr/lib/python2.4/site-packages/django/db/backends/util.py" in
execute
  12. return self.cursor.execute(sql, params)

  ProgrammingError at /provider/dataset/bulkreg/
  ERROR: syntax error at or near "{" at character 82 INSERT INTO
"vidars_bulkdataregfile" ("user_id","domain_id","bulk") VALUES (10,9,
{'content': '[ac.brms]\ntype: timeseries\nurl:
http://terra.sr.unh.edu/cgi-bin/dataserver.pl\nstart_date:
1997-08-27\nend_date: 200-12-18\nmetadata: These data have been
scraped from the NASA/CDAWEB website:\n 
http://cdaweb.gsfc.nasa.gov/cdaweb/istp_public/\n
They are only meant for internal use and VIDARS testing.\n Use at your
own risk! Jimmy Raeder [EMAIL PROTECTED]:
timeseries\nurl: http://terra.sr.unh.edu/cgi-bin/dataserver.pl\nstart_date:
1997-08-27\nend_date: 2004-12-31\nmetadata: These data have been
scraped from the NASA/\n\t CDAWEB website:http://cdaweb.gsfc.nasa.gov/
\n\t cdaweb/istp_public/ \n They are only meant for internal use and
VIDARS\n\t testing.Use at your own risk! Jimmy Raeder\n\n[ac.bygse]
\ntype: timeseries\nurl: 
http://terra.sr.unh.edu/cgi-bin/dataserver.pl\nstart_date:
1997-08-27\nend_date: 2004-12-31\nmetadata: These data have been
scraped from the NASA/\n\t CDAWEB website:http://cdaweb.gsfc.nasa.gov/
\n\t cdaweb/istp_public/ \n They are only meant for internal use and
VIDARS\n\t testing.Use at your own risk! Jimmy Raeder\n\n\n[ac.bzgse]
\ntype: timeseries\nurl: 
http://terra.sr.unh.edu/cgi-bin/dataserver.pl\nstart_date:
1997-08-27\nend_date: 2004-12-31\nmetadata: These data have been
scraped from the NASA/\n\t CDAWEB website:http://cdaweb.gsfc.nasa.gov/
\n\t cdaweb/istp_public/ \n They are only meant for internal use and
VIDARS\n\t testing.Use at your own risk! Jimmy Raeder \n\n[ac.he-rat]
\ntype: timeseries\nurl: 
http://terra.sr.unh.edu/cgi-bin/dataserver.pl\nstart_date:
1998-11-01\nend_date: 2000-07-31\nmetadata: These data have been
scraped from the NASA/\n\t CDAWEB website:http://cdaweb.gsfc.nasa.gov/
\n\t cdaweb/istp_public/ \n They are only meant for internal use and
VIDARS\n\t testing.Use at your own risk! Jimmy Raeder \n', 'content-
type': 'application/octet-stream', 'filename': 'testfile.ini'})


This is suppose to be a file upload view and this is the following
code for it:

@login_required
def bulk_reg(request):
    """Add large numbers of registrations by uploading a file"""
    manipulator = FileManipulator()
    data_domain = get_object_or_404(DataDomain, user=request.user.id)
    new_data = {}
    errors = {}

    if request.POST or request.FILES:
        new_data = request.POST.copy()
        new_data.update(request.FILES)
        errors = manipulator.get_validation_errors(new_data)

        if not errors:
            manipulator.do_html2python(new_data)

            fi = BulkDataRegFile(user = request.user,
                                 domain = data_domain,
                                 bulk = new_data['bulk'],)
            fi.save()

            return HttpResponseRedirect('/provider/')

    form = forms.FormWrapper(manipulator, new_data, errors)
    return render_to_response('provider/dataset/bulkreg.dht',
                              {'form': form},
 
context_instance=RequestContext(request),)

and this is the file manipulator that i made for this view

class FileManipulator(forms.Manipulator):

    def __init__(self):
        self.fields = (

            forms.FileUploadField(field_name="bulk",
is_required=True),

        )

so is there something im missing or is actually tweeking out about the
type of file it is,
the file upload works perfectly fine when i use it in the admin
interface.

Thanks for the help.

Jacob


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to