Re: loaddata issue
It seems like it was an issue with the transition from MySQL to PostgreSQL; I had been using build 6001 (as I noted at the end, sorry it wasn't very obvious), but I just ran svn update and was able to loaddata, although the project will remain on MySQL. On Aug 26, 9:16 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On 8/26/07, Drasty <[EMAIL PROTECTED]> wrote: > > > > > Loading 'courses' fixtures... > > Installing xml fixture 'courses' from '/../eeyore/courses/fixtures'. > > Problem installing fixture '/../eeyore/courses/fixtures/courses.xml': > > node is missing the 'name' attribute > > This sounds like there is an attribute missing in the output XML. Can > you provide an example model and data that causes this problem to > occur? > > > I receive this error if I dumpdata as JSON and attempt loaddata: > > > Installing json fixture 'courses' from '/../eeyore/courses/fixtures'. > > Problem installing fixture '/../eeyore/courses/fixtures/courses.json': > > column "enable_comments" is of type boolean but expression is of type > > integer > > This sounds like the data is not getting output correctly for a given > field type. Again, can you provide sample data? > > On top of the sample data, can you also please provide the version of > Django you are using (SVN revision or release number), and any other > configuration details - in particular, the source and target database. > > Yours, > Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
On 8/26/07, Drasty <[EMAIL PROTECTED]> wrote: > > Loading 'courses' fixtures... > Installing xml fixture 'courses' from '/../eeyore/courses/fixtures'. > Problem installing fixture '/../eeyore/courses/fixtures/courses.xml': > node is missing the 'name' attribute This sounds like there is an attribute missing in the output XML. Can you provide an example model and data that causes this problem to occur? > I receive this error if I dumpdata as JSON and attempt loaddata: > > Installing json fixture 'courses' from '/../eeyore/courses/fixtures'. > Problem installing fixture '/../eeyore/courses/fixtures/courses.json': > column "enable_comments" is of type boolean but expression is of type > integer This sounds like the data is not getting output correctly for a given field type. Again, can you provide sample data? On top of the sample data, can you also please provide the version of Django you are using (SVN revision or release number), and any other configuration details - in particular, the source and target database. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
loaddata issue
I'm attempting to use the loaddata action to load an XML file (generated using the dumpdata action on an MySQL db) to populate an app in a project that is using PostgreSQL for its db. I receive the following error: Loading 'courses' fixtures... Installing xml fixture 'courses' from '/../eeyore/courses/fixtures'. Problem installing fixture '/../eeyore/courses/fixtures/courses.xml': node is missing the 'name' attribute -- I receive this error if I dumpdata as JSON and attempt loaddata: Installing json fixture 'courses' from '/../eeyore/courses/fixtures'. Problem installing fixture '/../eeyore/courses/fixtures/courses.json': column "enable_comments" is of type boolean but expression is of type integer LINE 1: ...TO "courses_note" ("schedule_id","content","file","enable_co... ^ HINT: You will need to rewrite or cast the expression. -- Help! (I'm using svn trunk, build 6001.) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
On 5/7/07, Mark Jarecki <[EMAIL PROTECTED]> wrote: > > Hi Russ, > > Thank you for all your help, I renamed my app name and it works fine > at the moment. > > I posted a ticket (I hope its ok, my fist one) #4231. Ticket description was fantastic. FYI, I've fixed the problem in [5204]. The problem was some missing quotes in the generated SQL. The sequence name wasn't getting quoted in the sequence reset statement, so the capitalized application name was causing Postgres some grief. Thanks for the helpful report. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
Hi Russ, Thank you for all your help, I renamed my app name and it works fine at the moment. I posted a ticket (I hope its ok, my fist one) #4231. Thanks again, Mark. On 06/05/2007, at 10:21 AM, Russell Keith-Magee wrote: On 5/5/07, Mark Jarecki <[EMAIL PROTECTED]> wrote: > > > Hi Russ, > > Here is the transcript of the output: > > ./manage.py sqlall Guide Ok - found it. The problem is the capitalization on the application name. For some reason, django isn't taking the lower case version of the application name when specifying the database table in sequence reset code. As a sort term solution, if you rename the application `Guide` to `guide`, the problem will go away. If you could open a ticket for this issue, I'd be much obliged; i'll try to work up a permanent fix. Apologies for the inconvenience here, and thanks for the helpful debugging data. Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
Hi Russ, Here is the transcript of the output: ./manage.py sqlall Guide BEGIN; CREATE TABLE "Guide_venuetype" ( "id" serial NOT NULL PRIMARY KEY, "venueTypeName" varchar(200) NOT NULL, "venueTypeSlug" varchar(50) NOT NULL ); CREATE TABLE "Guide_venue" ( "id" serial NOT NULL PRIMARY KEY, "venueName" varchar(200) NOT NULL, "venueSlug" varchar(50) NOT NULL UNIQUE ); CREATE TABLE "Guide_venue_venueType" ( "id" serial NOT NULL PRIMARY KEY, "venue_id" integer NOT NULL REFERENCES "Guide_venue" ("id") DEFERRABLE INITIALLY DEFERRED, "venuetype_id" integer NOT NULL REFERENCES "Guide_venuetype" ("id") DEFERRABLE INITIALLY DEFERRED, UNIQUE ("venue_id", "venuetype_id") ); CREATE INDEX "Guide_venuetype_venueTypeName" ON "Guide_venuetype" ("venueTypeName"); CREATE INDEX "Guide_venuetype_venueTypeSlug" ON "Guide_venuetype" ("venueTypeSlug"); CREATE INDEX "Guide_venue_venueName" ON "Guide_venue" ("venueName"); CREATE UNIQUE INDEX "Guide_venue_venueSlug" ON "Guide_venue" ("venueSlug"); COMMIT; and here is the minimal data file that fails: cat test.json [{"pk": "1", "model": "Guide.venuetype", "fields": {"venueTypeSlug": "stadium", "venueTypeName": "Stadium"}}] Regards, Mark On 04/05/2007, at 10:10 PM, Russell Keith-Magee wrote: > > On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote: >> >> Running the latest django vesion, just ran svn. >> >> Cut down models: > .. > > I loaded some same venuetype data using the admin interface, dropped > the db, recreated it, synced and loaded the data; it worked fine for > me (Postgres 8.1 on OSX, psycopg1 backend) > > To try and track this further, can you provide: > - A copy of a minimal data file that failes > - A transcript of the output of ./manage.py sqlall guide (a listing of > the sql executed to create the models in the first place) > > Yours, > Russ Magee %-) > > > --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote: > > Running the latest django vesion, just ran svn. > > Cut down models: .. I loaded some same venuetype data using the admin interface, dropped the db, recreated it, synced and loaded the data; it worked fine for me (Postgres 8.1 on OSX, psycopg1 backend) To try and track this further, can you provide: - A copy of a minimal data file that failes - A transcript of the output of ./manage.py sqlall guide (a listing of the sql executed to create the models in the first place) Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
Running the latest django vesion, just ran svn. Cut down models: class VenueType(models.Model): venueTypeName = models.CharField(maxlength=200, db_index=True) venueTypeSlug = models.SlugField(prepopulate_from= ('venueTypeName',), db_index=True) class Admin: pass class Venue(models.Model): venueSlug = models.SlugField(prepopulate_from=('venueName',), unique=True, db_index=True) venueType = models.ManyToManyField(VenueType, filter_interface=models.HORIZONTAL) Error: Loading 'test' fixtures... Installing json fixture 'test' from absolute path. Installed 1 object(s) from 1 fixture(s) Traceback (most recent call last): File "./manage.py", line 11, in execute_manager(settings) File "/opt/python/lib/python2.5/site-packages/django/core/ management.py", line 1674, in execute_manager execute_from_command_line(action_mapping, argv) File "/opt/python/lib/python2.5/site-packages/django/core/ management.py", line 1588, in execute_from_command_line action_mapping[action](args[1:], int(options.verbosity)) File "/opt/python/lib/python2.5/site-packages/django/core/ management.py", line 1418, in load_data cursor.execute(line) File "/opt/python/lib/python2.5/site-packages/django/db/backends/ util.py", line 12, in execute return self.cursor.execute(sql, params) File "/opt/python/lib/python2.5/site-packages/django/db/backends/ postgresql/base.py", line 44, in execute return self.cursor.execute(sql, [smart_basestring(p, self.charset) for p in params]) psycopg.ProgrammingError: ERROR: relation "guide_venuetype_id_seq" does not exist SELECT setval('Guide_venuetype_id_seq', (SELECT max("id") FROM "Guide_venuetype")); Hope this helps. Thanks again, Mark On 04/05/2007, at 4:46 PM, Russell Keith-Magee wrote: On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote: > > Hi, > > I've come across an issue trying to loaddata into my database, and am > wondering if anyone else has come across this too? and how to go about > fixing it. > > I have Apache2.2.4, mod_python3.3.1, Python-2.5.1, postgresql-8.2.4, > psycopg2-2.0.5.1 installed. > > Please let me know if you require any more information. Django version? :-) > The following is the error I receive: ... > psycopg.ProgrammingError: ERROR: relation "guide_venuetype_id_seq" > does not > exist > > SELECT setval('Guide_venuetype_id_seq', (SELECT max("id") > FROM "Guide_venuetype")); The problem here is that the sequence providing data for the guide.venuetype table hasn't been created. The only reason I can think that this wouldn't exist is if you are using a custom primary key on your guide.venuetype table. Is this the case? Failing that, can you provide the models.py for the app that causes this problem (or preferably a cut down minimalist version that exhibits the problem)? Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: loaddata issue
On 5/4/07, Mark Jarecki <[EMAIL PROTECTED]> wrote: > > Hi, > > I've come across an issue trying to loaddata into my database, and am > wondering if anyone else has come across this too? and how to go about > fixing it. > > I have Apache2.2.4, mod_python3.3.1, Python-2.5.1, postgresql-8.2.4, > psycopg2-2.0.5.1 installed. > > Please let me know if you require any more information. Django version? :-) > The following is the error I receive: ... > psycopg.ProgrammingError: ERROR: relation "guide_venuetype_id_seq" does not > exist > > SELECT setval('Guide_venuetype_id_seq', (SELECT max("id") > FROM "Guide_venuetype")); The problem here is that the sequence providing data for the guide.venuetype table hasn't been created. The only reason I can think that this wouldn't exist is if you are using a custom primary key on your guide.venuetype table. Is this the case? Failing that, can you provide the models.py for the app that causes this problem (or preferably a cut down minimalist version that exhibits the problem)? Yours, Russ Magee %-) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
loaddata issue
Hi, I've come across an issue trying to loaddata into my database, and am wondering if anyone else has come across this too? and how to go about fixing it. I have Apache2.2.4, mod_python3.3.1, Python-2.5.1, postgresql-8.2.4, psycopg2-2.0.5.1 installed. Please let me know if you require any more information. This is the process i followed: ./manage.py dumpdata --format=json Guide > guide.json [Clear database] ./manage.py syncdb ./manage.py loaddata guide.json The following is the error I receive: Loading 'guide' fixtures... Installing json fixture 'guide' from absolute path. Installed 140 object(s) from 1 fixture(s) Traceback (most recent call last): File "./manage.py", line 11, in execute_manager(settings) File "/opt/python/lib/python2.5/site-packages/django/core/ management.py", line 1674, in execute_manager execute_from_command_line(action_mapping, argv) File "/opt/python/lib/python2.5/site-packages/django/core/ management.py", line 1588, in execute_from_command_line action_mapping[action](args[1:], int(options.verbosity)) File "/opt/python/lib/python2.5/site-packages/django/core/ management.py", line 1418, in load_data cursor.execute(line) File "/opt/python/lib/python2.5/site-packages/django/db/backends/ util.py", line 12, in execute return self.cursor.execute(sql, params) File "/opt/python/lib/python2.5/site-packages/django/db/backends/ postgresql/base.py", line 44, in execute return self.cursor.execute(sql, [smart_basestring(p, self.charset) for p in params]) psycopg.ProgrammingError: ERROR: relation "guide_venuetype_id_seq" does not exist SELECT setval('Guide_venuetype_id_seq', (SELECT max("id") FROM "Guide_venuetype")); Thanks in advance, Mark. --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---