Re: Error creating and saving a Django-object from the other script

2009-12-12 Thread tezro
Nope. Sorry for misdescription... Same error is "TypeError: 'slug' is an invalid keyword argument" when using: --- new_element = Element(title="title", date=datetime.now(), source=source_object, slug="slug") new_element.save() --- And the same "_mysql_exceptions.Warning: Field 'slug' doesn't have

Re: Error creating and saving a Django-object from the other script

2009-12-12 Thread Shawn Milochik
On Dec 12, 2009, at 8:08 AM, tezro wrote: > Nope. Did it again on a clean project with the same models migrated > then by South. > > Same error. Any other clues? > > Thanks for replies. When you say "same error," do you mean this one: "Duplicate key name 'news_element_slug'"? If so, then it

Re: Error creating and saving a Django-object from the other script

2009-12-12 Thread tezro
Nope. Did it again on a clean project with the same models migrated then by South. Same error. Any other clues? Thanks for replies. On Dec 12, 3:25 am, Shawn Milochik wrote: > Why did you manually add a 'slug' field to your database after modifying the > model? Django's syncdb does a lot more

Re: Error creating and saving a Django-object from the other script

2009-12-12 Thread tezro
Oops, sorry. Didn't remove the index. Now it worked. Proceeding :) On Dec 12, 3:51 pm, tezro wrote: > Added a migration with South... Ran it. > > --- > Running migrations for news: >  - Migrating forwards to 0002_add_slug. >  > news: 0002_add_slug > Traceback (most recent call last): >   File "/h

Re: Error creating and saving a Django-object from the other script

2009-12-12 Thread tezro
Added a migration with South... Ran it. --- Running migrations for news: - Migrating forwards to 0002_add_slug. > news: 0002_add_slug Traceback (most recent call last): File "/home/tezro/lib/python2.5/South-0.6.2-py2.5.egg/south/ migration.py", line 330, in run_migrations db.execute_deferr

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread Shawn Milochik
Why did you manually add a 'slug' field to your database after modifying the model? Django's syncdb does a lot more than just create the field; depending on which database you're using, it does a few other things and overrides some defaults. I wonder if there's a disconnect there. If this proje

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread tezro
Wooof, thanks for reply. Well, look. I had a "news/models.py" file with definitions of Source (type of news) and Element(the news elements theirselves) with a foreign key "Source". The script I used to gather news from different sites looks like this: --- title = "title" date=datetime.now()) new_e

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread Shawn Milochik
On Dec 11, 2009, at 4:51 PM, tezro wrote: > Seems like no clues... > > On Dec 10, 12:21 am, bruno desthuilliers > wrote: >> On 9 déc, 18:58, tezro wrote: >> (snip) >> >> >> >>> That throws an error: TypeError: 'slug' is an invalid keyword argument >>> for this function. >> >>> What am I do

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread tezro
Seems like no clues... On Dec 10, 12:21 am, bruno desthuilliers wrote: > On 9 déc, 18:58, tezro wrote: > (snip) > > > > > That throws an error: TypeError: 'slug' is an invalid keyword argument > > for this function. > > > What am I doing wrong? > > Not posting the full traceback - tracebacks are

Re: Error creating and saving a Django-object from the other script

2009-12-09 Thread tezro
That was really smart of you, thanks... Here's the traceback, hope it helps. --- Traceback (most recent call last): File "", line 1, in File "robot_parser.py", line 383, in update news = Element(source = the_source, title = title, date = date_published, short = short, full = full, link =

Re: Error creating and saving a Django-object from the other script

2009-12-09 Thread bruno desthuilliers
On 9 déc, 18:58, tezro wrote: (snip) > > That throws an error: TypeError: 'slug' is an invalid keyword argument > for this function. > > What am I doing wrong? Not posting the full traceback - tracebacks are here to help debugging a problem, not to fill your term with random gibberish !-) --

Error creating and saving a Django-object from the other script

2009-12-09 Thread tezro
Hi everyone. I'm using Django 1.1.0, importing it and using in another file "robot_parser.py". I've been using it for months. The script aggregates news from different sources and saves them using Django ORM. Presently I used primary key for urls (http://www.site.com/ news/2009/jan/12/72828/), but