Hi,
I am trying to work around with PDF's where user uploads PDF in image or filefield and then way to extract it for Django and finally update DB table based on it. Following are the models:
class StudentFee(models.Model):
class_name = models.CharField(choices=CLASSES, max_lenght=200)
fee_deposit_slip = models.ImageField(upload_to="students/")
def __unicode__(self):
return unicode(self.class_name)
All I need is to design a view where I can extract data from the PDF uploaded in the model below:
class StudentInfo(models.Model):
first_name = models.CharField(max_length=200)
last_name = models.CharField(max_length=200)
email=models.EmailField()
phone = PhoneField() #using phoneField custom field
def __unicode__(self):
return unicode(self.first_name)
All the fields in second model does exist in the PDF. In my Views.py
class StudentPDFReader(FormView):
template_name = 'pdfdata.html'
form_class = PDFForm
success_url = '/success/'
def form_valid(self, form):
# here I need to extract and add entries to modelform
return super(StudentPDFReader, self).form_valid(form)
Looking for kind help.
Regards,
Shazia