I'm working on writing some import scripts for large datasets, and I noticed that using the python shell through `frappe [site_name] --python` doesn't actually commit database changes through frappe.insert(). I would like to put my files on the server and run my commands through the terminal. Any way I can do that?
--
Note:
If you are posting an issue,
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e0a6b192-c2d1-4d25-b47b-f6527073f575%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Run frappe.db.commit() to commit :)-Anand.
On Wed, Aug 13, 2014 at 1:38 PM, Brendan Kiu <bren...@gmail.com> wrote:
I'm working on writing some import scripts for large datasets, and I noticed that using the python shell through `frappe [site_name] --python` doesn't actually commit database changes through frappe.insert(). I would like to put my files on the server and run my commands through the terminal. Any way I can do that?--
Note:
If you are posting an issue,
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
Cool, thanks! I'm guessing this gets run automatically when running from the site, so I don't need to do it when handling HTTP requests.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f0bf1283-63ab-4982-a89b-09552499c076%40googlegroups.com.
NameError: name 'frappe' is not defined
How do I import the frappe object from my external script, as well as set the site? Thanks.
You received this message because you are subscribed to a topic in the Google Groups "ERPNext Developer Forum" group.To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/4BBA8123-2BE0-445D-92FC-5FAEF3FBE4D7%40gmail.com.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/erpnext-developer-forum/uQI-jMQDXTA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAOSsix%3D%2BCXNxAUdSSQsJmexpWdDpNiOfUiDsKJCYAprROzo%3DNA%40mail.gmail.com.
raise RuntimeError('no object bound to %s' % self.__name__)
RuntimeError: no object bound to session
In my script I don't specify which site to use, so I'm guessing that needs to happen before I can access the frappe.new_doc(), etc methods.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF2s5bgXSM7V9B4cVSbpXkT-RMx5i5w9KrC4pqtCA%2BO_Sg%40mail.gmail.com.
Traceback (most recent call last):
File "import_children.py", line 84, in <module>
child = frappe.new_doc("My Doctype")
File "/home/linuxuser/frappe-bench/apps/frappe/frappe/__init__.py", line 335, in new_do
c
return get_new_doc(doctype, parent_doc, parentfield)
File "/home/linuxuser/frappe-bench/apps/frappe/frappe/model/create_new.py", line 17, in
get_new_doc
"owner": frappe.session.user,
File "/home/linuxuser/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local
.py", line 338, in __getattr__
return getattr(self._get_current_object(), name)
File "/home/linuxuser/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local
.py", line 301, in _get_current_object
raise RuntimeError('no object bound to %s' % self.__name__)
RuntimeError: no object bound to session
--
Note:
If you are posting an issue,
1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/43c175af-940b-451a-a6af-95e44e5eeafe%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
Do
```
frappe.init(sitename)
frappe.connect()
```