Hi Ian

Sorry I should have given you this info.

I am using Python 2.5.1 and Django 6051.

I get the following when I run a describe on the table - sorry it is a
bit messy


Object Type   TABLE Object   SURVEY

Table Column Data Type Length Precision Scale Primary Key Nullable
Default Comment
SURVEY ID Number -  11 0 1 -  -  -
  COMPANY_ID Number -  11 0 -  -  -  -
  OPERATOR_ID Number -  11 0 -   -  -
  CONTRACTOR_ID Number -  11 0 -   -  -
  VESSEL_ID Number -  11 0 -   -  -
  SURVEY_NAME Nvarchar2 100 -  -  -   -  -
  LOCATION Nvarchar2 60 -  -  -   -  -
  START_DATE Date 7 -  -  -  -  -  -
  END_DATE Date 7 -  -  -   -  -
  1 - 9


Thanks

Catriona




On Sep 19, 3:39 am, Ian <[EMAIL PROTECTED]> wrote:
> Catriona,
>
> What versions of Python and Django are you using?
> What output do you get from running a describe on the Survey model's
> table?
>
> Ian
>
> On Sep 17, 5:07 pm, Catriona <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello
>
> > I'm a newbie to Django and Python so sorry if this is a dumb mistake
> > on my behalf.
>
> > I have a model (using anOracleXE backend):
>
> > class Survey(models.Model):
>
> >         company = models.ForeignKey(Company, null = False, blank = False)
> >         survey_name = models.CharField(max_length = 50, null = False, blank 
> > =
> > False)
> >         location = models.CharField(max_length = 30, null = False, blank =
> > False)
> >         start_date = models.DateField(null = False, blank = False)
> >         end_date = models.DateField(null = True, blank = True)
>
> > and have a view
>
> > def addEditSurvey(request, id=None):
>
> >         if id is None:
> >                 SurveyForm = forms.models.form_for_model(Survey)
> >         else:
> >                 survey = Survey.objects.get(id=id)
> >                 SurveyForm = forms.models.form_for_instance(survey)
>
> >         if request.POST:
> >                 f = SurveyForm(request.POST)
> >                 if f.is_valid():
> >                         newItem = Survey(company_id=1,
> > survey_name=f.cleaned_data['survey_name'],
> > location=f.cleaned_data['location'],start_date=f.cleaned_data['start_date']-,
> > end_date=f.cleaned_data['end_date'])
> >                         newItem.save()
> >         else:
> >                 f = SurveyForm()
>
> >         return render_to_response('add_survey.html', {'form':f})
>
> > The problem is that I am getting "ORA-01722: invalid number" when
> > trying to save the form.
>
> > Any help would be greatfully appreciated.
>
> > Catriona- Hide quoted text -
>
> - Show quoted text -


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