Re: new field in models

2013-07-24 Thread Christian Erhardt
I'd go with  Satinderpal Singh advice. Use South. It takes some time to get 
used to it, but when you realize how it's working, it absolutely awesome

Am Montag, 22. Juli 2013 09:53:00 UTC+2 schrieb Harjot Mann:
>
> In django when we add a new field in existing class, we need to drop 
> the table and then run the syncdb again. Is there any alternative for 
> it so that we can add the field without dropping the table?? 
>
> -- 
> Harjot Kaur Mann 
> Blog: http://harjotmann.wordpress.com/ 
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: new field in models

2013-07-23 Thread Serdar Dalgic
On Mon, Jul 22, 2013 at 10:53 AM, Harjot Mann  wrote:
> In django when we add a new field in existing class, we need to drop
> the table and then run the syncdb again. Is there any alternative for
> it so that we can add the field without dropping the table??
>

You can also run sqldiff django command if you have django_extensions
installed in your django app.

See http://pythonhosted.org/django-extensions/sqldiff.html for
details. It gives you the difference between your model and the
database structure. Then, you can apply this difference to your db.


-- 
- Serdar Dalgıç 
FLOSS Developer, Life & Nature Hacker
twitter:
https://twitter.com/serdaroncode
https://twitter.com/serdarintowild

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: new field in models

2013-07-22 Thread Harjot Mann
On Mon, Jul 22, 2013 at 2:33 PM, Satinderpal Singh
 wrote:
> South is an alternative, it creates table fields without syncdb.


Ok, you didn't tell me before.

--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: new field in models

2013-07-22 Thread Larry Martell
On Mon, Jul 22, 2013 at 1:53 AM, Harjot Mann  wrote:
> In django when we add a new field in existing class, we need to drop
> the table and then run the syncdb again. Is there any alternative for
> it so that we can add the field without dropping the table??

Use alter table:

http://dev.mysql.com/doc/refman/5.1/en/alter-table.html

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: new field in models

2013-07-22 Thread Harjot Mann
On Mon, Jul 22, 2013 at 2:11 PM, Floor Tile  wrote:
> Hello Harjot
>
> I think you should look at South: south.aeracode.org/
>
> For the docs you can go to: south.readthedocs.org/
>
> Hope it helps


Hello Floor, thanks.

--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: new field in models

2013-07-22 Thread Floor Tile
Hello Harjot

I think you should look at South: south.aeracode.org/

For the docs you can go to: south.readthedocs.org/

Hope it helps


On Mon, Jul 22, 2013 at 9:53 AM, Harjot Mann wrote:

> In django when we add a new field in existing class, we need to drop
> the table and then run the syncdb again. Is there any alternative for
> it so that we can add the field without dropping the table??
>
> --
> Harjot Kaur Mann
> Blog: http://harjotmann.wordpress.com/
>
> --
> 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.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




Re: new field in models

2013-07-22 Thread Satinderpal Singh
On Jul 22, 2013 1:23 PM, "Harjot Mann"  wrote:
>
> In django when we add a new field in existing class, we need to drop
> the table and then run the syncdb again. Is there any alternative for
> it so that we can add the field without dropping the table
South is an alternative, it creates table fields without syncdb.

--
Satinderpal Singh

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.




new field in models

2013-07-22 Thread Harjot Mann
In django when we add a new field in existing class, we need to drop
the table and then run the syncdb again. Is there any alternative for
it so that we can add the field without dropping the table??

--
Harjot Kaur Mann
Blog: http://harjotmann.wordpress.com/

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.