Commit graph

117 commits

Author SHA1 Message Date
Rushabh Mehta
d6f09c5325
[optimize] frappe.db.count with cache (#5355) 2018-04-02 19:24:41 +05:30
Rushabh Mehta
f20da41bf6 [fix] rename custom fields before sync if name conflicts (#5062)
* [fix] rename custom fields before sync if name conflicts

* [minor] re-add text_type

* Update doctype.py
2018-02-23 11:10:21 +05:30
Faris Ansari
1c24dae099
[hotfix] Docname as int (#4976)
* [hotfix] Docname passed as number

* typo
2018-02-07 12:29:10 +05:30
Achilles Rasquinha
b8825ca116 Pure Python MySQL instead mysqlclient (with Python C API) (#4280)
* added PyMYSQL instead mysqlclient-python

* added pymysql import

* fixed db module import

* foxed self._conn wrapper

* updated cursor migration

* removed existent converters

* some more fixes towards API port

* modified travis

* updated doctype and revereted yml

* modified travis

* refreshed logging

* raw fix

* moved from hard coded constants to declarable instances

* moved from hard coded constants to declarable instances

* refactoring and logging

* moved to global import declaration

* fixed codacy

* unfixed codacy

* minor fix

* binary_type has a single

* deprecated alternative

* merged with latest

* fixed merge conflicts

* using deprecated alternative

* raw fix

* stupid fix

* using StringTypes instead

* brutal hack

* log

* tundebazy to the rescue

* fixed content_hash error

* frappe/database.py

* frappe/database.py

* updated database.py

* updated requirements

* updated requirements

* fixed codacy

* fixed codacy

* moved from DatabaseOperationalError to pymysql.InternalError

* moved from DatabaseOperationalError to pymysql.InternalError

* fixed codacy

* empty commit

* fixed codacy

* fixed codacy
2017-11-06 16:42:01 +05:30
Revant Nandgaonkar
4df6135c3c enqueue_after_commit option added to frappe.enqueue (#4167)
* enqueue_after_commit option added to frappe.enqueue

* Fixes

Codacy https://www.codacy.com/app/frappe/frappe/pullRequest?prid=934733
clear frappe.flags.enqueue_after_commit after executing enqueued jobs

* sync_global_search() uses enqueue_after_commit=True

* Update database.py

* webhooks enqueue after commit

* Update __init__.py
2017-10-18 11:43:02 +05:30
Aditya Hase
79b2b93958 Pass positional arguments instead of keyword arguments to MySQLdb.connect 2017-09-04 16:05:57 +05:30
Aditya Hase
cd9c357d2b Covert filter to list before checking it's length 2017-09-04 16:05:57 +05:30
Aditya Hase
06d9bd0a1f Explicitly convert dict.keys() to list 2017-08-22 18:18:50 +05:30
Rushabh Mehta
ce48aaa2c9 Merge branch 'develop' into fix-long 2017-08-11 12:59:02 +05:30
Aditya Hase
69c255661d Replaced long with six.integer_types 2017-08-11 00:32:26 +05:30
Aditya Hase
769338f136 Replaced all instances of basestring with six.string_types 2017-08-11 00:10:11 +05:30
mbauskar
e4675498bb Merge branch 'master' into staging 2017-08-04 11:02:07 +05:30
Nabin Hait
b524d892f7 Add where clause only if conditions exists (#3853) 2017-08-03 17:02:47 +05:30
Aditya Hase
7c9c53840a Replaced types import with six (#3834)
Importing six.text_type instead of types.UnicodeType and
six.binary_type instead of types.StringType
2017-08-02 17:04:56 +05:30
Aditya Hase
e6bd1e4995 Replaced all instances of 'unicode' with 'six.text_type' (#3825) 2017-08-02 16:57:39 +05:30
felixvarghese
f189829240 Allow SSL connections to a remote database server (#3742)
* Allow SSL connections to a remote database server

Add the following options in site_config.json to use ssl

- "db_ssl_ca" = "/path/to/ca/cert.pem"
- "db_ssl_cert" = "/path/to/ssl/cert.pem"
- "db_ssl_key" = "/path/to/ssl/key.pem"

The files mentioned should be stored on the App server in the location mentioned.

This commit allows for basic ssl connections. X509 is still not supported.

If the above options are not set, the connection will not use an encrypted connection, and connect normally.

* docs - Allow SSL to remote database host
2017-07-20 18:00:02 +05:30
Rushabh Mehta
45cbb7facc [minor] cleanups and optimization fixes 2017-06-20 12:46:43 +05:30
tundebabzy
bbde2ec4cf rewrite use of dict.iteritems (#3498)
* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility

* dict.iteritems to six.iteritems(dict) for python3 compatibility
2017-06-19 09:10:21 +05:30
Prateeksha Singh
d8fb2c2c0d [fix] Enqueue syncing global search (#3455)
* [fix] Enqueue syncing global search

* make passing flags optional

* Create global_search.py
2017-06-16 11:02:22 +05:30
tundebabzy
6fbe20caaa Except and raise statement python 3 compatible style (#3216)
* changes exception and raise statements to python 3 style

* changes except statement to python 3 style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* changes except and raise statement to python 3 compatible style

* adds six.reraise to fix python 3 style raise statements with traceback

* fixes indentation
2017-05-11 10:51:59 +05:30
Rushabh Mehta
ba289eaa62 [minor] remove print 2017-03-15 15:31:16 +05:30
Rushabh Mehta
d453dea055 [minor] catch tag count exception for filters that include child tables 2017-03-15 15:02:08 +05:30
Rushabh Mehta
1e7229c45f [enhance] global search in website (#2810)
* [enhance] global search in website

* [fix] create table query

* [website] navbar search in header if set

* [minor] navbar_search in website settings
2017-03-07 16:37:50 +05:30
Rushabh Mehta
86ceb21005 [feature] Global Search (again) (#2710)
* [start] global search frappe/erpnext#6674

* [fix] setup before running test

* [start] global search frappe/erpnext#6674

* Display result as rudimentary list, rebuild old doctypes

* Media view, child tables, delete document updates, searchable fields

* More results UI

* Code clean up

* remove msgprint from document.py to resolve merge conflict

* Modularization stage 1, get show more to work with it

* Dedicated modal Search bar works, some clean up needed

* Can't data-dismiss on links, Bootstrap issue, use hashchange

* Accomodate missing field content syndrome

* Search in boolean mode, make GS default in awesome bar, fix double modal bug and cleanup

* Add in Meta

* Add in customize form

* Modularise Global Search

* Search object

* Commonify Search UI: Stage I

* II: save list state, UI, default condensed view, refactor

* Fix SQL bug, Refactor awesome bar, Fix unicode bug, add nav results

* Refactor using separate search objects, some async issues

* Fix async flow

* Fix preceding more list bug

* UI additions

* another async fix, back link

* Help: Stage I

* Help: Stage II

* Background jobs, fix route options bug

* Fix GS syncing on install

* Add GS options in awesome bar: test

* Input now remembers search type state

* More UI updates

* Add description for GS results in awesome bar

* Fix help modal bug

* Fix: not commit during install

* Test cases, some fixes

* Update in_test flag in enqueue

* Disable GS sync when not install_db

* Add flag check

* Disable field in child tables

* Cleanups

* Create table fix

* Fix redis exception, remove commit enqueue, add gs in migrate

* Fix tests

* Single enqueue

* cleanups

* Fix tests

* Fix event test

* Fix duplication, search as first option

* Add show name in global search

* fix event tests and desk.less

* Fix communication.json

* [fixes] wip

* [fix] tests

* [minor] for tests

* [minor] for tests

* [minor] for tests

* [minor] for tests
2017-02-13 14:50:54 +05:30
Rushabh Mehta
385da2b7b1 [check] use utf8mb4 as the connection charset 2017-01-30 14:15:44 +05:30
Rushabh Mehta
d989a95472 [feature] document versioning #2469 (#2523)
* [feature] document versioning #2469

* [minor] remove on_update from WebsiteGenerator

* [fix] delete shares when deleting user

* [test] don't run delete in background if test

* [fix] test_db

* [added] Deleted Document

* [fix] added track_changes in all documents

* [fix] add to deleted only if exists

* [fix] in_install flag in deleted documents

* [minor] name will always be reset
2016-12-29 18:01:42 +05:30
Rushabh Mehta
4bd2285159 File Based Locking at Document Level (#2374)
* [redesign] improved locking in documents and redesigned recent documents

* [minor] patch to update doctype in existing documents
2016-11-25 16:14:00 +05:30
robert schouten
aed15c02ae add order_by to get_value and document (#2357) 2016-11-22 22:15:13 +05:30
Rushabh Mehta
a099690e8f Revert "[optimize] remove count(*) from queries" (#2353) 2016-11-22 10:55:13 +05:30
Rushabh Mehta
0ff140fa2b [optimize] remove count(*) from queries 2016-11-21 14:58:18 +05:30
rohitwaghchaure
abc4996a20 Added docstring for get_single_value, get_singles_dict methods (#2292) 2016-11-19 13:02:49 +05:30
Rushabh Mehta
3b93e04887 [fix] frappe.db.set_value 2016-11-17 09:45:44 +05:30
Rushabh Mehta
9ef8f18fcf [fix] for tests, and db_set now accepts dict 2016-11-17 09:45:44 +05:30
Anand Doshi
f2a7ce3dc0 [fix] removed mysql auto-connect on 'mysql has gone away' 2016-07-14 14:38:26 +05:30
Anand Doshi
5feaf817db [fix] reconnect if mysql has gone away 2016-06-20 17:39:37 +05:30
Rushabh Mehta
c9f4a16893 [fix] [tests] 2016-03-31 12:21:20 +05:30
Rushabh Mehta
123842ffda [enhancement] edit-profile in frappe 2016-03-30 17:15:03 +05:30
Rushabh Mehta
c955e001b4 [fix] minor update realtime 2016-02-17 16:32:48 +05:30
Rushabh Mehta
e1ac647a13 [cleanup] system settings, added deny_multiple_sessions 2016-02-16 15:05:59 +05:30
Nabin Hait
930cd7d78e [fix] Get defaults based on doctype or fieldname 2015-12-23 16:34:43 +05:30
Anand Doshi
5572f24c5d [fix] A percentage in file name caused 404 error in case of private file while checking permissions 2015-12-21 15:44:50 +05:30
Anand Doshi
357e61f9d5 [fix] injection 2015-11-17 18:27:29 +05:30
Rushabh Mehta
d3dc9711f0 [enhancement] added **not like** in filter options 2015-11-05 11:18:15 +05:30
Cristi Harjoi
006a2a1754 [fix] database: escape percent sign in strings 2015-10-23 14:03:38 +03:00
Anand Doshi
ad493f7942 [fix] permission tests 2015-09-08 17:29:31 +05:30
Rushabh Mehta
22d3c513cc [minor] enhancements to frappe.db.get_single_value. Now cached and converted to integer for 0 and 1 2015-09-03 11:15:47 +05:30
Anand Doshi
9a9790a78c Merge branch 'commit-only-on-write' of https://github.com/rmehta/frappe into rmehta-commit-only-on-write
Conflicts:
	frappe/website/doctype/web_page/web_page.json
2015-08-17 14:14:10 +05:30
Anand Doshi
baec4f855f Change Check fields to have default as 0 (if not specified) and not null 2015-07-30 11:54:27 +05:30
Rushabh Mehta
1654c5b038 [minor] commit only if there were writes 2015-07-21 13:33:49 +05:30
Rushabh Mehta
562b1b2c50 [fixes] cleanup of web from, portal, login page 2015-06-01 17:14:53 +05:30