@webnotes.whitelist method

Hello All,
   I am using Document object in @webnotes.Whitelist method to insert record in database, But the records are not inserted in databases.
   My codes pastebin link is "http://pastebin.com/7UPqFu0m"

It return the all above values but the records are not created.

Please suggest.

Thanks and Regards,
Gangadhar kadam




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/45fb70fc-4865-4cf2-be3f-a198a2a874fb%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

On Tue, Feb 25, 2014 at 10:47 AM, gangadhar kadam em...@gmail.com wrote:

Hello All,
I am using Document object in @webnotes.Whitelist method to insert record
in database, But the records are not inserted in databases.
My codes pastebin link is “@webnotes.whitelist()def get_login(username,password): webbrowser.ope - Pastebin.com

If you are using GET method, then commit to database doesn’t happen.

You could do one of the following things, (in order of recommendation)

  • Send a POST request
  • Send a param, _type=POST
  • Put a webnotes.conn.commit() at the end of your function.

It return the all above values but the records are not created.

Please suggest.

Thanks and Regards,
Gangadhar kadam


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send
    only the URL via email
  3. 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+un...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/45fb70fc-4865-4cf2-be3f-a198a2a874fb%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks,

Pratik
erpnext

Thank you Pratik,
   I am trying to implement this for wsgi . (this method will be called from another python application).

   Can you please give an example to call this method using post from outside of application .

Thanks and regards,
Gangadhar kadam

On Tuesday, 25 February 2014 10:47:27 UTC+5:30, gangadhar kadam wrote:
Hello All,
   I am using Document object in @webnotes.Whitelist method to insert record in database, But the records are not inserted in databases.
   My codes pastebin link is "http://pastebin.com/7UPqFu0m"

It return the all above values but the records are not created.

Please suggest.

Thanks and Regards,
Gangadhar kadam




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/0b288c77-d509-426b-a88f-ccc6892a3a60%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.

On Tue, Feb 25, 2014 at 1:23 PM, gangadhar kadam em...@gmail.com wrote:

Thank you Pratik,
I am trying to implement this for wsgi . (this method will be called from
another python application).

Are you making an HTTP request?

Can you please give an example to call this method using post from
outside of application .

Thanks and regards,
Gangadhar kadam

On Tuesday, 25 February 2014 10:47:27 UTC+5:30, gangadhar kadam wrote:

Hello All,
I am using Document object in @webnotes.Whitelist method to insert
record in database, But the records are not inserted in databases.
My codes pastebin link is “@webnotes.whitelist()def get_login(username,password): webbrowser.ope - Pastebin.com

It return the all above values but the records are not created.

Please suggest.

Thanks and Regards,
Gangadhar kadam


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send
    only the URL via email
  3. 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+un...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/erpnext-developer-forum/0b288c77-d509-426b-a88f-ccc6892a3a60%40googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Pratik
erpnext

Yes Pratik, we will call this method using http post method.
   for testing purpose i will use poster plugin of firefox.

Thank you.

On Tuesday, 25 February 2014 10:47:27 UTC+5:30, gangadhar kadam wrote:
Hello All,
   I am using Document object in @webnotes.Whitelist method to insert record in database, But the records are not inserted in databases.
   My codes pastebin link is "http://pastebin.com/7UPqFu0m"

It return the all above values but the records are not created.

Please suggest.

Thanks and Regards,
Gangadhar kadam




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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+un...@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/27d8b9f5-236a-4141-84bd-26f32c020122%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.