On Fri, Mar 25, 2011 at 7:20 PM, maxi <maxiroba...@gmail.com> wrote: > On 25 mar, 19:21, Gabriel Hurley <gab...@gmail.com> wrote: > > The extra object is in the initial_data.json fixture which is loaded > > automatically. If you're not seeing that object than something is wrong > with > > your initial_data fixture loading. > > > > - Gabriel > > Hi Gabriel, > Thank for response. > > I see now what I have an error when try to load modeltests/aggregation/ > fixtures/initial_data.json > > This is the traceback: > > Problem installing fixture '/home/maxi/projects/django/django/tests/ > modeltests/aggregation/fixtures/initial_data.json': Traceback (most > recent call last): > File "/home/maxi/projects/django/django/django/core/management/ > commands/loaddata.py", line 174, in handle > obj.save(using=using) > File "/home/maxi/projects/django/django/django/core/serializers/ > base.py", line 165, in save > models.Model.save_base(self.object, using=using, raw=True) > File "/home/maxi/projects/django/django/django/db/models/base.py", > line 553, in save_base > result = manager._insert(values, return_id=update_pk, using=using) > File "/home/maxi/projects/django/django/django/db/models/ > manager.py", line 195, in _insert > return insert_query(self.model, values, **kwargs) > File "/home/maxi/projects/django/django/django/db/models/query.py", > line 1436, in insert_query > return query.get_compiler(using=using).execute_sql(return_id) > File "/home/maxi/projects/django/django-firebird/forks/bitbucket/ > django-firebird/firebird/compiler.py", line 114, in execute_sql > cursor = super(SQLCompiler, self).execute_sql(None) > File "/home/maxi/projects/django/django/django/db/models/sql/ > compiler.py", line 735, in execute_sql > cursor.execute(sql, params) > File "/home/maxi/projects/django/django-firebird/forks/bitbucket/ > django-firebird/firebird/base.py", line 231, in execute > return self.cursor.execute(cquery, params) > DatabaseError: (-530, u'isc_dsql_execute: \n violation of FOREIGN KEY > constraint "CONTACT_ID_REFS_ID_48084965" on table > "AGGREGATION_BOOK"\n Foreign key reference target does not exist -- > INSERT INTO "AGGREGATION_BOOK" ("ID", "ISBN", "NAME", "PAGES", > "RATING", "PRICE", "CONTACT_ID", "PUBLISHER_ID", "PUBDATE") VALUES (1, > 159059725, The Definitive Guide to Django: Web Development Done Right, > 447, 4.5, 30.00, 1, 1, 2007-12-06)') > > > Here, the problem seems to be what is trying to insert > aggregation.book contact_id (which refers to Author model) before to > insert aggregation.author. > > In initial_data.json aggregation.author data come after to > aggregation.book which violate the referencial integrity. > > Is it an error or I'm doing something wrong? > > Thanks for you help. > > > > > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-developers@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > > This problem looks similar to one we see under MySQL InnoDB becaue it doesn't properly support deferred constraints.
Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.