On Sat, May 16, 2015 at 9:26 AM, mangu rajpurohit
<rajpurohitma...@gmail.com> wrote:
> Hi,
>
> I am new to Django. I am working on an application ,where the types of table
> fields in database are not known before hand. So, say for eg. In student
> table, I am assigning CharField to marks field, ie
>
> class Student(models.Model):
>      marks = model.CharField(max_length = 3)
>
> and after Student table in database is populated, can I change the type of
> marks to IntegerField as shown below :-
>
> class Student(models.Model):
>      marks = model.IntegerField()
>
>
> Is it possible ? If not feasible, then what are the alternatives ways/design
> strategies or what should be done in such cases ? If feasible, then what are
> its side-effects ?

Why can't you just alter the table:

alter table student modify marks int;

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CACwCsY7C0dKNRfMcCv1C%2Bvwq89R0huu0krU7jp6uoTR%3D3jLNQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to