Questions tagged [loaddata]

193 questions
181
votes
13 answers

Django dump data for a single model?

Can I perform a dumpdata in Django on just a single model, rather than the whole app, and if so, how? For an app it would be: python manage.py dumpdata myapp However, I want some specific model, such as "myapp.mymodel" to be dumped. The reason…
nategood
  • 11,807
  • 4
  • 36
  • 44
57
votes
1 answer

Programmatically using Django's loaddata

I'd like to call the equivalent of manage.py loaddata from a Django view. I'd like to be able to specify where to load the data from and which application to load it into. Any ideas?
Deniz Dogan
  • 25,711
  • 35
  • 110
  • 162
39
votes
1 answer

argument for generic parameter could not be inferred

I'm trying to save an array with NSUserDefaults and then load the array, but I get the error "argument for generic parameter could not be inferred." Is there anything I am doing wrong? No one seems to be having this problem in swift, so I can't find…
l-spark
  • 871
  • 2
  • 10
  • 25
23
votes
7 answers

Django loaddata UNIQUE constraint failed

I'm running python manage.py loaddata 'path/to/mydata.json' with an empty database (User and UserProfile tables are created but not populated), however, I'm getting the following error: django.db.utils.IntegrityError: Problem installing fixture…
jeff
  • 13,055
  • 29
  • 78
  • 136
20
votes
7 answers

Android WebView - 1st LoadData() works fine, subsequent calls do not update display

After the 1st call to LoadData() the event onLoadResource fires as it should and the display is fine. Next I want to refresh the screen with a new page, when I use LoadData() the second time the page does not update and onLoadResource() DOES NOT…
Jim
  • 1,966
  • 3
  • 24
  • 33
18
votes
4 answers

Had to load data twice to make WebView refresh in Android

When I first create the activity, everything goes fine. However, after I choose from menu to change some text of the String values and set the webview by webview.loadData(result, "text/html; charset=UTF-8", null); webview.loadData(result,…
Owen Zhao
  • 3,205
  • 1
  • 26
  • 43
15
votes
2 answers

Django : loaddata to update data

I have a fixture seed_data.json on which I have my initial data. Sometimes I add new data into this fixtures and reload it, which updates my data correctly. However, I now want to remove some data from it. So I modified my seed_data.json, for…
Ellone
  • 3,644
  • 12
  • 40
  • 72
13
votes
1 answer

Django loaddata ignore existing objects

I have a fixture with list of entries. eg: [ { "fields": { "currency": 1, "price": "99.99", "product_variant": 1 }, "model": "products.productprice", "pk": 1 }, { "fields": { "currency": 2, …
Quba
  • 4,776
  • 7
  • 34
  • 60
10
votes
2 answers

Duplicate key issue when loading back.json file PostgreSQL

I have a PostgreSQL database that where I performed python manage.py dumpdata to backup the data into a json file. I created a new PostgreSQL database, performed a migrate, and everything worked like clockwork. When I tried to load the backup.json…
TJB
  • 3,706
  • 9
  • 51
  • 102
7
votes
1 answer

android webview and loadData, can i get the back button to return to generated content?

I have an android webview that displays generated content with loadDataWithBaseURL. Looks great. However, if i follow a link and then hit the back button I get a blank page where I'd like to see my generated content. does anyone know how I can use…
Matthew Kime
  • 754
  • 1
  • 6
  • 15
7
votes
1 answer

difference between loadData() and loadDataWithBaseURL() in WebView class.....?

can anybody tell me the difference between loadData() and loadDataWithBaseURL() in WebView class. when i used web.loadDataWithBaseURL("",html, mimetype, encoding,""); in my program , where html is the string that contains hard coded html tags, its…
Ash
  • 71
  • 1
  • 5
6
votes
1 answer

export data from Django database

how to copy records from one database to another django ? I tried for the first database python manage.py dumpdata material - indent = 1 material is the directory database after ? material.json ? do I copy this file somewhere? in the second…
user1788104
  • 81
  • 1
  • 5
5
votes
2 answers

Android youtube in webview

I have using Webview to display some html data in my app. I am using the following code. WebView featureview = (WebView) findViewById(R.id.featureview); WebSettings webSettings = featureview.getSettings(); webSettings.setJavaScriptEnabled(true);…
dev_android
  • 8,698
  • 22
  • 91
  • 148
5
votes
3 answers

Using loadDataWithBaseURL disables links in webview

I use the following code to load html content of ebooks where templateString contains the html content which connects to stylesheet and images in the main file. String itemURL = "file://" + itemPath; testWV.loadDataWithBaseURL(itemURL, …
coder
  • 5,200
  • 3
  • 20
  • 45
5
votes
1 answer

Convert a d3 chart to load data from json inside a variable

I'm trying to make a bar chart with d3, and for this I'm following this tutorial d3noob chart, everything looks good but I'm unable to load the data from a JSON inside a variable instead of load from a JSON file, i've managed to load the json to a…
Biguá
  • 183
  • 3
  • 13
1
2 3
12 13