Questions tagged [django-fixtures]

A fixture is a collection of data that Django knows how to import into a database, can be written as XML, YAML, or JSON documents. They can be used to provide initial data for models.

187 questions
0
votes
1 answer

Referencing models.site in fixtures file used to populate multisite

[ { "model": "django.contrib.Site", "pk": 1, "fields": { "domain_name": "en.localhost", "display_name": "EN site" } }] I've made an app and put the fixture above in a directory name 'fixtures'. When I run python…
rix
  • 10,104
  • 14
  • 65
  • 92
0
votes
1 answer

Reset form values from fixture content

Using Django 1.5, I need a Default values button with my form. The form is a forms.ModelForm and the model is populated using Django fixtures when the application is deployed. Basically, the reset button would fetch the fixture content and update…
Mathieu Marques
  • 1,678
  • 15
  • 33
0
votes
1 answer

Initial Data Django Fixtures Issue: Installed 0 object(s) from 0 fixture(s)

I am having a little trouble with importing initial data through xml files. For example I name this file in myapp/fixtures/initial_data.xml: myapp.nutrition Asiago…
user1532761
  • 29
  • 1
  • 7
0
votes
1 answer

Google App Engine: Django Load Fixtures

Normally we load fixtures, like: python manage.py loaddata fixture.yaml but to upload to google database, it was suggested on here previously: python manage.py loaddata remote fixture.yaml , but when I try, it says Unknown command: 'remote' I use…
Emmet B
  • 5,341
  • 6
  • 34
  • 47
0
votes
0 answers

How to modify dumpdata generated django json fixture prior to loading into database

I am a relative django newbie. I have a json fixture for the django.contrib.auth.user objects from an existing database that I want to load into my test app. The specific field I want to modify are all the Datetime Fields that do not have UTC…
harijay
  • 11,303
  • 12
  • 38
  • 52
0
votes
0 answers

Django database with ForeignKey and Fixture

I am trying to implement a restaurant chief website. So basically, I have States, Cities, Restaurants and Chiefs. Class State(models.Model): name = models.CharField(max_length=30) Class City(models.Model): name =…
Emmet B
  • 5,341
  • 6
  • 34
  • 47
0
votes
2 answers

Django and Dynamic Example Data

I'm trying to find a way to easily generate an example/demonstration data set from initial_data.json in Django. Essentially, the fixtures and initial_data.json do exactly what I need, except that the dates are static.... My app uses dates to…
Erve1879
  • 845
  • 1
  • 14
  • 26
1 2 3
12
13