Commit graph

1741 commits

Author SHA1 Message Date
mergify[bot]
b76f79c06c
Merge pull request #14547 from Aradhya-Tripathi/query-conversion
refactor: Converting raw SQL queries using frappe ORM and frappe.qb
2021-11-03 12:06:35 +00:00
Gavin D'souza
e989bfa41d style: Indents & file headers 2021-11-03 16:12:27 +05:30
mergify[bot]
53a2539c5a
feat(minor): Implement __getitem__ in Base Document (#14855) (#14866)
* feat(minor): Implement __getitem__ in Base Document

This addition allows for syntactic sugars like writing doc["name"] to
access document name. This addition is solely for the sake of code
simplicity. Since dictionaries in Python follow this standard, we can
write code that works for both Vanilla Dicts, Frappe Dicts & all
Document objects

* fix: Use getattr over get in getitem

For the sake of consistency and some level of sanity in the universe.

Co-authored-by: Ankush Menat <ankush@frappe.io>

* fix: Raise KeyError instead of AttributeError

why: shit breaks down. Specifically stuff in Jinja templates, attributes
that are conditional. Either this is acceptable or subscripting objects
cannot and probably should not be possible along with our pre-condiitons

* chore: Use hasattr instead of get default

Couldn't decide between a style commit or a chore

Co-authored-by: Ankush Menat <ankush@frappe.io>
(cherry picked from commit 583a7ef23923d362c85beeabe57703c2d5b12a65)

Co-authored-by: gavin <gavin18d@gmail.com>
2021-11-02 13:24:36 +05:30
Gavin D'souza
ccb53c0f5b fix: If column comparision is done, dont check for ifnull/coalesce 2021-10-29 14:19:28 +05:30
Gavin D'souza
9bf043eddf fix(db_query): Change fallback to min datetime 2021-10-29 13:24:28 +05:30
Gavin D'souza
9be8a0895d Merge branch 'develop' into between-formatting 2021-10-29 13:13:55 +05:30
Suraj Shetty
9189c62437 fix: Pass parent_doctype while checking permission for child_table in db_query 2021-10-27 13:52:34 +05:30
Suraj Shetty
64822df6ff
Merge branch 'develop' into fix-has-permission-for-child-doc 2021-10-27 13:07:44 +05:30
Suraj Shetty
0f98b4d174 fix: Make parent_doctype mandatory while accessing child doctype 2021-10-27 12:59:42 +05:30
Aradhya-Tripathi
cd9e0ffa84 refactor: converted queries in nameing and nestedset 2021-10-26 22:20:03 +05:30
Aradhya-Tripathi
94f2a6e275 feat: Added run kwarg to get_all, get_values 2021-10-23 15:08:02 +05:30
mergify[bot]
c616e557fd
Merge pull request #14358 from dj12djdjs/feat-bulk-rename-merge
feat: bulk rename allow merge option
2021-10-21 08:05:44 +00:00
Mohammad Hasnain
08ac2eda0a Merge branch 'develop' into between-formatting 2021-10-20 19:37:43 +05:30
Mohammad Hasnain
d7b7afeb14 fix: format between for creation/ modified 2021-10-19 16:18:21 +05:30
Sagar Vora
5c86dc80c7
fix: if_owner constraint being applied wrongly (#14471)
* fix: `if_owner` constraint being applied wrongly

* test: check if owner on `frappe.get_list`

Co-authored-by: Pruthvi Patel <pruthvipatel145@gmail.com>
2021-10-19 15:03:17 +05:30
Devin Slauenwhite
12e4b33a1f
fix: simplify merge condition statement
Co-authored-by: gavin <gavin18d@gmail.com>
2021-10-13 11:26:24 -04:00
abhishek
ba78852c73 docs: add docstring for import_file_by_path 2021-10-12 17:15:12 +05:30
abhishek
f3d810414a refactor: sync_for() - first install module 2021-10-11 18:59:06 +05:30
abhishek
0be59cee80 chore: add missing document_types 2021-10-11 18:59:06 +05:30
abhishek
69d8eddf5a refactor: remove unused args
refactor: remove unused args
2021-10-11 17:23:17 +05:30
abhishek
278883edb0 fix: missing migration hash column 2021-10-11 17:23:17 +05:30
abhishek
b2b391e90a style: misc 2021-10-11 17:23:17 +05:30
Gavin D'souza
c3be3d35e8 fix: "function"al programming++ 2021-10-11 17:23:17 +05:30
Devin Slauenwhite
2c9f08997a
Merge branch 'frappe:develop' into feat-bulk-rename-merge 2021-10-09 13:10:04 -04:00
Sagar Vora
6b91ade73c
fix: convert_dates_to_str converts everything except date objects (#14340)
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
2021-10-07 15:58:23 +05:30
Devin Slauenwhite
d61d4214cf Merge branch 'develop' into feat-bulk-rename-merge 2021-10-04 14:19:41 -04:00
Devin Slauenwhite
a8347c0b27 feat: allow bulk rename with merge 2021-10-04 14:15:54 -04:00
Suraj Shetty
2f427a82c8 Merge branch 'develop' of https://github.com/frappe/frappe into form-tab-break 2021-09-20 15:49:01 +05:30
Gavin D'souza
09557ab8c7 fix(db_query): Add fallback value irrespective of operator 2021-09-16 15:22:37 +05:30
Suraj Shetty
1cd20c04a7 Merge branch 'develop' of https://github.com/frappe/frappe into form-tab-break 2021-09-16 13:00:07 +05:30
Gavin D'souza
6973a34828 Merge branch 'develop' into compare-columns-db_query 2021-09-16 11:40:33 +05:30
Gavin D'souza
ad5783b1c3 fix: Use PyPika's Column
also, Discard Data class. Since we're adding support for PyPika objects
to natively interact with the Frappe ORM, this PR brings us closer
toward that direction.
2021-09-16 11:38:23 +05:30
Gavin D'souza
3adc459e4d Merge branch 'develop' of github.com:frappe/frappe into trim-db 2021-09-14 21:53:21 +05:30
Gavin D'souza
0413349cc8 fix: Table view for bench trim-tables 2021-09-14 21:53:02 +05:30
Steffen
4415351597 fix: hand no_default_fields parameter further down to recursive calls of as_dict 2021-09-09 10:28:27 +02:00
Gavin D'souza
ab7dee13cf chore: Added return type for DatabaseQuery.execute 2021-09-06 19:44:25 +05:30
Gavin D'souza
9f4f096bf1 Merge branch 'develop' into compare-columns-db_query 2021-09-06 11:38:55 +05:30
Gavin D'souza
43459749e2 Merge branch 'develop' into trim-db 2021-09-06 11:35:59 +05:30
Rushabh Mehta
20dea90670 feat(minor): Packages! also cleanup of DocField and other minor fixes 2021-09-05 22:01:55 +05:30
Suraj Shetty
ed806c2c74 Merge branch 'develop' of https://github.com/frappe/frappe into form-tab-break 2021-09-04 15:37:58 +05:30
Gavin D'souza
4127f0f135 fix: Clear table columns cache to fetch accurate results 2021-09-03 18:59:56 +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
7e2e8c87ff Merge branch 'develop' into get-single-value-oof 2021-08-30 13:49:35 +05:30
Gavin D'souza
b8c51b13e2 fix: Revert to using cast_fieldtype in BaseDocument.cast
* reference: revert Breaking Change -
  https://github.com/frappe/frappe/pull/13989#discussion_r695624003
* Show deprecation warning unless `show_warning` is unset
2021-08-30 13:45:30 +05:30
Suraj Shetty
30a09490b5
Merge branch 'develop' into get-frmt 2021-08-27 11:12:27 +05:30
Suraj Shetty
743e361449
Merge branch 'develop' into core-test-coverage-1 2021-08-23 11:02:50 +05:30
Gavin D'souza
ed6533f737 fix: Use cast in favour of cast_fieldtype
Use newly introduced casting util for Python-Frappe types mapping
2021-08-20 12:37:15 +05:30
Gavin D'souza
32c6cf1c44 refactor(misc): frappe.db.delete > frappe.db.sql
Use frappe.db.delete wherever possible. Get rid of all the frappe.db.sql ;)

This commit focuses on the pending modules that had relatively easier
DELETE statements.
2021-08-19 19:53:16 +05:30
Suraj Shetty
a7fb1816aa refactor: Remove unused and redundant code 2021-08-19 15:27:25 +05:30
Gavin D'souza
7f338edca1 feat: Command to trim tables
Maintenance command to get rid of extra columns in your DocType tables.
These columns are remnants of "deleted" fields through customizations or
upgrades
2021-08-17 12:50:11 +05:30