deep1
#1
import frappe
from frappe import auth
import json
from frappe.utils import data
@frappe.whitelist(allow_guest=True)
def inserts(state, y):
parent = frappe.get_doc({‘doctype’: ‘state’})
parent.statename = state
app = json.loads(y)
parent.append("weather1", {
"temp": app.get("temp"),
"season": app.get("season"),
"date": app.get("date")
})
parent.insert(ignore_permissions=True)
parent.save()
What does “multiple entries in same state” mean ?
Can you provide an example?
deep1
#3
suppose my postman data state=usa,y={“season”:“winter”,“temp”:28,“date”:“2022-08-08”}
but i can update in temp in same state usa but it has not allow to change temp they have ask duplicate entry state
In your DocType, if the naming is based on field_name:state then this will be that tables primary key. Therefore no duplicate entries.
You must change the way the DocType is named.