xrmx / django-denis Goto Github PK
View Code? Open in Web Editor NEWDenis helps you recovering accidentally deleted data from a django project
License: MIT License
Denis helps you recovering accidentally deleted data from a django project
License: MIT License
It looks like we load the m2m middle table but we don't load the second leg of the m2m relationship, in this case testdenis.EvenMoreData;
PROCESSING testdenis.somedata
Installed 1 object(s) from 1 fixture(s)
PROCESSING testdenis.somedata_evenmore
Traceback (most recent call last):
File "/home/rm/src/django-denis/test_django_denis/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
utility.execute()
File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
output = self.handle(*args, **options)
File "/usr/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 61, in handle
self.loaddata(fixture_labels)
File "/usr/lib/python2.7/dist-packages/django/core/management/commands/loaddata.py", line 97, in loaddata
connection.check_constraints(table_names=table_names)
File "/usr/lib/python2.7/dist-packages/django/db/backends/sqlite3/base.py", line 454, in check_constraints
referenced_table_name, referenced_column_name))
django.db.utils.IntegrityError: Problem installing fixtures: The row in table 'testdenis_somedata_evenmore' with primary key '1' has an invalid foreign key: testdenis_somedata_evenmore.evenmoredata_id contains a value '1' that does not have a corresponding value in testdenis_evenmoredata.id.
PROCESSING testdenis.somemoredata
Installed 1 object(s) from 1 fixture(s)
M2M tables are failing loading because entries are added two times: from the model with the m2m field and then from the m2m intermediate model. This break tests.
We can do some introspection with the meta api:
https://docs.djangoproject.com/en/1.8/ref/models/meta/
There could be multiple approaches:
Tests are failing because we are loading data to the main db instead of the test one. This can be resolved by specifying the database in the loaddata commands.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.