Commit graph

25 commits

Author SHA1 Message Date
Sagar Vora
f9bfbfec98
perf: reduce DB calls made in get_fetch_values (#17671)
* perf: reduce DB calls made in `get_fetch_values`

* fix: ensure return value is same as before

* test: add test for `frappe.model.utils.get_fetch_values`
2022-08-05 11:52:37 +05:30
Ankush Menat
2e85a49fd2
refactor: remove test doctype from core (#17598)
This was commited by mistake, instead of using the test doctype, create
it on demand for tests.
2022-08-01 19:05:13 +05:30
Ankush Menat
e88bc35cae refactor: move is_virtual_doctype to relevant file 2022-07-22 14:25:48 +05:30
Ankush Menat
81b37cb7d2
refactor: clean up code to py310 supported features (#17367)
refactor: clean up code to py39+ supported syntax

- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes

Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
2022-07-01 11:51:05 +05:30
Gavin D'souza
b696fa6da5 perf: Pre-compile and re-use regexp pattern
Converted all possible usages of re.* that weren't compiling the regex
separately and re-using it. Separated out the compiled patterns as
global variables. Repetitive patterns could be made DRY-er.

Would be nicer to have all regexes in a single module so that we could
re-use better, keep track of outdated, and keep checks for possible
reDos' etc
2022-06-08 14:07:38 +05:30
Suraj Shetty
c0c5b2ebdd
style: format all python files using black (#16453)
Co-authored-by: Frappe Bot <developers@frappe.io>
2022-04-12 10:59:25 +05:30
Gavin D'souza
3446026555 chore: Update header: license.txt => LICENSE
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
2021-09-03 12:02:59 +05:30
Gavin D'souza
e407b78506 chore: Drop dead and deprecated code
* Remove six for PY2 compatability since our dependencies are not, PY2
  is legacy.
* Removed usages of utils from future/past libraries since they are
  deprecated. This includes 'from __future__ ...' and 'from past...'
  statements.
* Removed compatibility imports for PY2, switched from six imports to
  standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
  versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
2021-05-26 15:31:29 +05:30
Anurag Mishra
570fd44248 fix: Translating Errors and Messages 2019-07-03 11:52:47 +05:30
Zarrar
e76b3eef4e [Enhance] New DocField - 'Fetch From' (#5563)
* add new docfield fetch_from - serves as add_fetch

* replace options.split with fetch_from.split

* copied data from options to fetch_from

* patch to update fetch_from for docfield, custom_field and property_setter

* update tests according to fetch_from change
2018-05-23 11:07:57 +05:30
Achilles Rasquinha
496a63f07f fix _cast_result 2018-04-02 14:23:20 +05:30
Achilles Rasquinha
b4be0a79c1 fix timestamp mismatch for all singles 2018-03-31 17:34:36 +05:30
Achilles Rasquinha
6598be192f cast for standard fieldnames 2018-03-31 14:57:42 +05:30
Achilles Rasquinha
4433250cda Python 3 fixes 2018-02-13 12:27:02 +05:30
Aditya Hase
e6bd1e4995 Replaced all instances of 'unicode' with 'six.text_type' (#3825) 2017-08-02 16:57:39 +05:30
Rushabh Mehta
6a725d6c95 [cleanups] 2017-06-22 18:21:48 +05:30
tundebabzy
6e29d9e925 xrange to range (#3237)
* introduces build status for local fork

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range

* converts xrange to range using six.moves.range

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* converts xrange to range using six.moves.range7

* Revert "introduces build status for local fork"

This reverts commit 61f40983d0b3c6725369171ab850a18e5c029cc4.
2017-05-11 10:55:34 +05:30
tundebabzy
7b41d7e5eb Python 3 compatible print statements (#3199)
* changes print statements in file to python 3 compatible style using `__future__`

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* changes deprecated md5 module to hashlib

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements

* adds python 3 style for print statements
2017-05-01 12:34:29 +05:30
Rushabh Mehta
863aebcc78 [fixes] for translation and save full url for 404 2016-07-25 11:01:28 +05:30
Rushabh Mehta
349a65402f [website] fixes for generating docs 2016-06-23 18:22:03 +05:30
Anand Doshi
9c5e1199de [css] cleanup + moved products and homepage to erpnext + [fix] get_js 2016-04-22 18:52:47 +05:30
Rushabh Mehta
b902d1e8cc [enhancements] now can {% include %} in page js files and also write jinja like tags in js templates 2016-04-21 19:00:07 +05:30
Rushabh Mehta
daa9c094d0 [enhancement] [wip] links menu in forms 2016-04-12 19:16:17 +05:30
Rushabh Mehta
78607beeee [cleanup] print format css and default print view 2016-04-06 15:29:55 +05:30
Rushabh Mehta
56b2317ea0 [fix] property setter for idx 2015-07-10 20:32:54 +05:30