Changing module as per CSV content

15 views
Skip to first unread message

Kishan Mehta

unread,
Apr 14, 2015, 12:44:05 PM4/14/15
to django...@googlegroups.com
Hi,

I have following CSV file :

Sample #,Gender,Handedness
1,Female,Right-handed
2,Male,Left-handed
3,Female,Right-handed
4,Male,Right-handed

Models.py :

class CsvStore(models.Model):

sample_number = models.IntegerField(null = True)
gender = models.CharField(max_length=6)
handedness = models.CharField(max_length=12)


Question : Can we change our model if content of csv file changes ?
Is it possible ?

suppose if CSV i upload has :


Sample #,Gender,Handedness,Age
1,Female,Right-handed, 23
2,Male,Left-handed,24
3,Female,Right-handed,35
4,Male,Right-handed,34

The above model wont work .

Thanks for help.

Kishan Mehta
Reply all
Reply to author
Forward
0 new messages