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
; A better solution, just ignore irregular case extensions completely. | |
(defun jslint-hook () | |
(let* ((filename (buffer-file-name)) | |
(suffix (file-name-extension filename))) | |
(if (and filename (string= suffix "js")) | |
(call-interactively 'compile)))) | |
(add-hook 'after-save-hook 'jslint-hook) |
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
def human_readable_datetime(dt): | |
right_now = datetime.now() | |
if right_now.year == dt.year: | |
if right_now.month == dt.month: | |
# Same day | |
if right_now.day == dt.day: | |
datetime_format = '%I:%M %p' | |
# Within 2 days. | |
elif right_now.day <= dt.day + 2 and right_now.day >= dt.day - 2: | |
datetime_format = '%a %I:%M %p' |
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
def human_readable_datetime(dt): | |
right_now = datetime.now() | |
if right_now.year == dt.year: | |
if right_now.month == dt.month: | |
# Same day | |
if right_now.day == dt.day: | |
datetime_format = '%I:%M %p' | |
# Within 2 days. | |
elif right_now <= dt + timedelta(days=2) and \ | |
right_now >= dt - timedelta(days=2): |
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 Post(object): | |
#... | |
@classmethod | |
def factory(cls, request): | |
if 'post_id' in request.matchdict: | |
post = cls.from_identifier(request.matchdict['post_id']) | |
if not post or not post.is_published(): | |
raise NotFound() |
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
var Feed = { | |
highlightStory: function () { | |
var uri, urlQuery, storyId, queryObject, storyGroupEl; | |
uri = window.location.search.toString(); | |
urlQuery = uri.substring(uri.indexOf("?") + 1, uri.length); | |
queryObject = ioQuery.queryToObject(urlQuery); | |
if (queryObject.story_id) { | |
storyId = queryObject.story_id; | |
window.location.hash = storyId; | |
} else { |
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 model="ir.ui.view" id="inventory_view_form"> | |
<field name="model">inventory.inventory</field> | |
<field name="type">form</field> | |
<field name="arch" type="xml"> | |
<![CDATA[ | |
<form string="Inventory" col="4"> | |
<label name="warehouse"/> | |
<field name="warehouse"/> | |
<label name="lost_found"/> | |
<field name="lost_found"/> |
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 model="ir.action.act_window" id="act_inventory_form"> | |
<field name="name">Inventories</field> | |
<field name="res_model">inventory.inventory</field> | |
<field name="search_value">[('create_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0, delta_years=-1))]</field> | |
</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
<%def name="layoutdata(somedata)"> | |
<table> | |
% for item in somedata: | |
<tr> | |
% for col in item: | |
<td>${caller.body(col=col)}</td> | |
% endfor | |
</tr> | |
% endfor | |
</table> |
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 model="ir.action.act_window" id="act_inventory_form"> | |
<field name="name">Inventories</field> | |
<field name="res_model">inventory.inventory</field> | |
<field name="search_value">[('create_date', '>=', DateTime(hour=0, minute=0, second=0, microsecond=0, delta_years=-1))]</field> | |
</record> | |
File "/home/ian/workspace/tryton-project/stockmodules-tryton-2.6/tryton-instance/tryton/tryton/gui/window/view_form/view/list.py", line 732, in __sig_switch | |
if not self.screen.row_activate() and self.children_field: |
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
diff -r 91e0c59c47aa tryton/common/domain_parser.py | |
--- a/tryton/common/domain_parser.py Thu Jan 03 16:29:35 2013 +0100 | |
+++ b/tryton/common/domain_parser.py Sat Jan 19 13:33:42 2013 -0800 | |
@@ -749,9 +749,9 @@ | |
def string_(clause): | |
if not clause: | |
return '' | |
- if (isinstance(clause[0], basestring) | |
- and (clause[0] in self.fields | |
- or clause[0] == 'rec_name')): |
OlderNewer