This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Many2OneField(SelectField): | |
| """ | |
| A select field that works like a many2one field in tryton | |
| Additional arguments | |
| :param model: The name of the model | |
| :param domain: Tryton search domain | |
| """ | |
| def __init__(self, label=None, validators=None, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script type="text/javascript" src="//code.jquery.com/jquery-1.8.0.min.js"></script> | |
| <script type="text/javascript"> | |
| $(document).ready( | |
| function() { | |
| sse = new EventSource('/my_event_source'); | |
| sse.onmessage = function(message) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from connection import NetSuiteConnect | |
| from SuiteREST import SuiteRequest | |
| from forms import send_error | |
| class ExportFulfillments(object): | |
| def __init__(self): | |
| self.instance = NetSuiteConnect() | |
| self.conn = self.instance.erp_connection() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (navigator.userAgent.match(/iPad/i)) { | |
| $('chozen-widget-created').bind('touchstart', function(event) { | |
| $(this).trigger('click'); | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <record id="activate_url" model="nereid.url_rule"> | |
| - <field name="rule">/<language>/activate-account/<int:user_id>/</field> | |
| + <field name="rule">/<language>/activate-account/<int:active_id>/</field> | |
| <field name="endpoint">nereid.user.activate</field> | |
| <field name="sequence" eval="70" /> | |
| <field name="http_method_get" eval="True"/> | |
| <field name="http_method_post" eval="True"/> | |
| <field name="url_map" ref="default_url_map" /> | |
| </record> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <record> | |
| <field name="rule">/<language>/logout</field> | |
| <field name="endpoint">nereid.website.logout</field> | |
| <field name="sequence" eval="30" /> | |
| + <field name="http_method_get" eval="True"/> | |
| <field name="url_map" ref="default_url_map" /> | |
| </record> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <record> | |
| <field name="rule">/<language>/login</field> | |
| <field name="endpoint">nereid.website.login</field> | |
| <field name="sequence" eval="20" /> | |
| - <field name="methods">("GET", "POST")</field> | |
| + <field name="http_method_get" eval="True"/> | |
| + <field name="http_method_post" eval="True"/> | |
| <field name="url_map" ref="default_url_map" /> | |
| </record> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CSVReportEngine(ModelView): | |
| """CSV reports for ...""" | |
| _name = 'csv.report.engine' | |
| def report_tracking_numbers(self, data, buffer): | |
| "Tracking Numbers" | |
| shipment_obj = self.pool.get('stock.shipment.out') | |
| move_obj = self.pool.get('stock.move') | |
| domain = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> print chr.__doc__ | |
| chr(i) -> character | |
| Return a string of one character with ordinal i; 0 <= i < 256. | |
| >>> print unichr.__doc__ | |
| unichr(i) -> Unicode character | |
| Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from mongoengine import Document, StringField | |
| class Machine(Document): | |
| data_center = StringField(choices=[ | |
| ('us-east', 'US East'), | |
| ('us-west', 'US West'), | |
| ('sa-sao', 'South America (SAO)'), | |
| ('eu', 'European Union'), | |
| ]) |