Hello,I've got a very tight deadline, and I'm encountering a very frustrating problem. Every time I try to use loaddata to load my data into my database, I get the loaddata error in the subject. I've tried YAML, I've tried JSON, I've tried excerpting only a few lines of each, all to no avail. I'm really at my rope's end. I don't think my models are flawed in any significant way--each refers to only one field in one other model (the primary key in four out of five of them).I need to get this working by the 2nd, and I've looked all over the internet and posted a question at Stackoverflow and still can't figure it out. I really need some help.Thanks,-sam--
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/-/WLBxL9nsC1IJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
I've got a very tight deadline, and I'm encountering a very frustrating problem. Every time I try to use loaddata to load my data into my database, I get the loaddata error in the subject. I've tried YAML, I've tried JSON, I've tried excerpting only a few lines of each, all to no avail. I'm really at my rope's end. I don't think my models are flawed in any significant way--each refers to only one field in one other model (the primary key in four out of five of them).
--
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/-/FCFXKNxtvAIJ.
Thanks for your suggestions.I eliminated the underscores and got rid of the __unicode__ methods entirely, cleaned up my except statement, and changed the order of stuff such that all of each model's fields are defined before any methods. (As for the pk field: The csvs I'm using are actually dumps from another database, so everything has its own primary key already, and I realized it's way easier to just leave them alone rather than waste the processing time and memory reconnecting everything via Python.)I'm still having the same problem. I don't think it's related to the length of the files or something in simplejson, as even a dozen-line yaml file gives me the same exception when I try to load it with loaddata.
Any more ideas?
--
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/-/pq_mI5E031EJ.
So I upped the verbosity like you said, and basically all it got me was a bunch of text telling me all the places Django didn't find my fixture before it finally did, and then the same error. Here's the full text of the error:Traceback (most recent call last):File "/home/menusadmin/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 190, in handlefor obj in objects:File "/home/menusadmin/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/serializers/pyyaml.py", line 62, in Deserializerraise DeserializationError(e)DeserializationError: maximum recursion depth exceeded while calling a Python objectI tried changing commit to False in loaddata.py, I tried adding a manager class to the one model I have that another model refers to with a natural key (e.g., 'name,' a CharField, as opposed to the primary key). I read something about loaddata having some unicode-related problems, so I added custom Manager classes for all my models that coerce appropriate fields to strings, e.g.:class MenuManager(models.Manager):def create_Menu(self,restaurant,year,location,status,pk,period,language):menu = self.create(restaurant=str(restaurant),year=int(year),location=str(location),status=str(status),pk=int(pk),period=str(period),language=str(language))return menuI'm still getting the exact same error. Help?
#!/usr/bin/env pythonimport yamlstream = open("test.yml", "r")print yaml.load(stream)
./manage.py validate
--
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/-/WoMoRX8i3DsJ.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.