Re: How to avoid "no such column" error when I add a new property to a model?

2012-01-13 Thread David Harks
On Jan 11, 2012, at 4:26 AM, callum  wrote:

> I created an "Article" model with a few simple properties. I ran
> syncdb, and set up the Django admin site, and added
> "admin.site.register(Article)" in admin.py. Using the Django admin
> site, I created an article by filling in the form.
>
> I then went into models.py and added another property. I ran syncdb
> again, ran the server again, then when I opened the Django admin site
> again, I got the "no such column" error.
>
> When I Googled this, the only obvious solutions I found were to reset
> the app, or at least drop the database table that changed, and start
> over.
>
> But how do I do this without losing my data?
>

Check out South. http://south.aeracode.org

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to avoid "no such column" error when I add a new property to a model?

2012-01-11 Thread Andre Terra
Or use a GUI tool like PgAdmin[0] for PostgreSQL, which is packaged into
most psql distributions.


Cheers,
AT

[0] http://www.pgadmin.org/



On Wed, Jan 11, 2012 at 6:30 PM, Python_Junkie <
software.buy.des...@gmail.com> wrote:

> For those who do not want to use another abstraction module, just use
> sql on the database to add the column.
>
> Look up the alter table command for the database that you are using.
>
> On Jan 11, 5:26 am, callum  wrote:
> > I created an "Article" model with a few simple properties. I ran
> > syncdb, and set up the Django admin site, and added
> > "admin.site.register(Article)" in admin.py. Using the Django admin
> > site, I created an article by filling in the form.
> >
> > I then went into models.py and added another property. I ran syncdb
> > again, ran the server again, then when I opened the Django admin site
> > again, I got the "no such column" error.
> >
> > When I Googled this, the only obvious solutions I found were to reset
> > the app, or at least drop the database table that changed, and start
> > over.
> >
> > But how do I do this without losing my data?
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to avoid "no such column" error when I add a new property to a model?

2012-01-11 Thread Python_Junkie
For those who do not want to use another abstraction module, just use
sql on the database to add the column.

Look up the alter table command for the database that you are using.

On Jan 11, 5:26 am, callum  wrote:
> I created an "Article" model with a few simple properties. I ran
> syncdb, and set up the Django admin site, and added
> "admin.site.register(Article)" in admin.py. Using the Django admin
> site, I created an article by filling in the form.
>
> I then went into models.py and added another property. I ran syncdb
> again, ran the server again, then when I opened the Django admin site
> again, I got the "no such column" error.
>
> When I Googled this, the only obvious solutions I found were to reset
> the app, or at least drop the database table that changed, and start
> over.
>
> But how do I do this without losing my data?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to avoid "no such column" error when I add a new property to a model?

2012-01-11 Thread Daniel Roseman
On Wednesday, 11 January 2012 10:26:32 UTC, callum wrote:
>
> I created an "Article" model with a few simple properties. I ran 
> syncdb, and set up the Django admin site, and added 
> "admin.site.register(Article)" in admin.py. Using the Django admin 
> site, I created an article by filling in the form. 
>
> I then went into models.py and added another property. I ran syncdb 
> again, ran the server again, then when I opened the Django admin site 
> again, I got the "no such column" error. 
>
> When I Googled this, the only obvious solutions I found were to reset 
> the app, or at least drop the database table that changed, and start 
> over. 
>
> But how do I do this without losing my data?


I can't believe your Googling didn't reveal the canonical solution:
http://south.aeracode.org/
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jC-y1rKnyLUJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to avoid "no such column" error when I add a new property to a model?

2012-01-11 Thread callum
I created an "Article" model with a few simple properties. I ran
syncdb, and set up the Django admin site, and added
"admin.site.register(Article)" in admin.py. Using the Django admin
site, I created an article by filling in the form.

I then went into models.py and added another property. I ran syncdb
again, ran the server again, then when I opened the Django admin site
again, I got the "no such column" error.

When I Googled this, the only obvious solutions I found were to reset
the app, or at least drop the database table that changed, and start
over.

But how do I do this without losing my data?

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.