Commit graph

55 commits

Author SHA1 Message Date
Tyson Clugg
4fc7f2179f Consistent handling of client side vs server side errors. 2016-01-08 17:38:41 +11:00
Matthew Schinckel
599818e900 Remove reliance on django-dbarray.
Remove old-style aggregate gunk.

Resolves #3
2016-01-05 21:59:53 +10:30
Tyson Clugg
a23d2f8056 Crude support for pub access to this.user. 2015-12-16 21:16:16 +11:00
Tyson Clugg
f8539b9253 Fix doctest in API module. 2015-12-15 10:15:07 +11:00
Tyson Clugg
f1b4f0798d Don't require DJANGO_SETTINGS_MODULE to import API. 2015-11-23 10:10:07 +11:00
Tyson Clugg
a3c9f9c802 Python3 compatibility fixes in dddp.api. 2015-10-29 09:53:52 +11:00
Tyson Clugg
4c0fd40ebd Fix bug causing some subscription queries to use inefficient SQL. 2015-10-14 02:59:02 +11:00
Tyson Clugg
27c270f40f Fixes #6 (again) -- Python 3 style exception handling. 2015-10-13 23:44:15 +11:00
Tyson Clugg
80238bc785 Make the SQL for subscriptions much faster to run.
The PostgreSQL query planner knows to short-circuit some operators such
as IN or ANY such that `foo_id IN (SELECT foo.id FROM foo WHERE ...)`
doesn't need to perform a full table scan on foo.

This change ensures that `user_rel` WHERE clauses use the `IN` operator
to take advantage of the greatly improved performance.
2015-10-13 23:13:41 +11:00
Tyson Clugg
b14b2a427e New setting DDP_API_ENDPOINT_DECORATORS.
Takes a list of dotted import paths to decorators which are applied to API
endpoints.  For example, enable New Relic instrumentation with the following:

```
DDP_API_ENDPOINT_DECORATORS = ['newrelic.agent.background_task']
```
2015-10-13 11:05:02 +11:00
Tyson Clugg
f15efc0930 Use select_related() and resultant cached relational fields to speed up Colleciton.serialize(). 2015-09-25 11:30:48 +10:00
Tyson Clugg
04ef1ab8a0 More aggressive searching for local AleaIdField(unique=True) when translating between meteor/object identifiers. 2015-08-13 09:46:31 +10:00
Tyson Clugg
93abd0a6b7 Merge branch 'develop' into feature/AleaIdField_as_primary_key
Conflicts:
	dddp/server/views.py
	dddp/views.py
2015-08-11 15:36:54 +10:00
Tyson Clugg
7083c5c92f Chunked payload for NOTIFY/LISTEN to get around 8KB limit on payload. 2015-08-10 18:47:04 +10:00
Tyson Clugg
5ec27b669c Add BackdoorServer support to dddp command, add "Logs" publication. 2015-08-10 16:34:39 +10:00
Tyson Clugg
d7dd9f2bb5 Merge branch 'develop' into feature/AleaIdField_as_primary_key 2015-07-23 08:53:59 +10:00
Tyson Clugg
d762fa45c4 Updated error handling to ensure error reply to method messages when appropriate. 2015-07-22 10:33:21 +10:00
Tyson Clugg
d358ce413a Never assume this.user_id is available. 2015-07-21 21:23:37 +10:00
Tyson Clugg
36199d27c1 Call ready() for each registered API provider as part of AppConfig.ready(). 2015-07-21 19:17:21 +10:00
Tyson Clugg
b059fe37da Allow silent sub/unsub to support Meteor null publications. 2015-07-21 09:55:55 +10:00
Tyson Clugg
01f6d9eed4 Merge branch 'develop' into feature/AleaIdField_as_primary_key 2015-07-16 09:06:48 +10:00
Tyson Clugg
244567c3ba Bugfix /app.model/schema helper method to work with more model field types. 2015-07-16 08:46:12 +10:00
Tyson Clugg
43b35a12ce Add models and various shortcuts to allow for AleaIdField with primary_key=True. 2015-07-14 09:31:42 +10:00
Tyson Clugg
781ea8e7a2 Pylint cleanups. 2015-07-09 09:19:13 +10:00
Tyson Clugg
dfd52ebb32 Cleanup Collection.user_ids_for_object(obj) method.
* Removed `include_superusers` argument, replaced with class level `always_allow_superusers` attribute.
* Removed unused `base_qs` argument.
* Don't test for obj being a primary key when running query since obj is assumed to be an object in the prior lines of code anyway.
2015-07-09 08:52:10 +10:00
Tyson Clugg
2f69881e14 Handle django.contrib.postgres.fields.ArrayField in serialization. 2015-06-16 17:50:10 +10:00
Tyson Clugg
07ccc014bc Fix array aggregate for Django 1.8 2015-06-14 03:31:27 +10:00
Tyson Clugg
2ad5e28452 WIP on Django 1.8 compatibility. 2015-06-12 23:08:27 +10:00
Tyson Clugg
2cfb3ebe12 Pylint: reduce number of variables in method. 2015-06-05 09:38:15 +10:00
Tyson Clugg
65927e20e6 Don't emit change messages for migrations/ddp apps. 2015-06-05 09:37:36 +10:00
Tyson Clugg
1e000d2892 Show method input params after traceback if exception occurs. 2015-06-05 09:36:49 +10:00
Tyson Clugg
b8bf33a992 Remove shadown method definition. 2015-06-05 09:36:12 +10:00
Tyson Clugg
f02fba6d9f Refactor serialization to imporove performance (less DB queries) and add support for auth updating subscriptions. 2015-05-28 10:53:29 +10:00
Tyson Clugg
a8b0883a39 Support optional on M2M fields with blank=True for schema generation. 2015-05-27 14:31:23 +10:00
Tyson Clugg
f5f127e9ba Check order of added/changed when emitting WebSocket frames, don't try to emit removed when client doesn't have the item. 2015-05-27 14:28:30 +10:00
Tyson Clugg
fa51d89575 Fix order of added/changed messages by deferring id checking until emitting WebSocket frames. 2015-05-27 12:48:16 +10:00
Tyson Clugg
c7ecd60ea7 Refactor pub/sub functionality to fix support for removed. 2015-05-21 12:51:43 +10:00
Tyson Clugg
f1d031313f Bugfix issue where DDP connection thread stops sending messages after changing item that has subscribers for other connections but not self. 2015-05-20 15:05:05 +10:00
Tyson Clugg
0542e31f3d Fix added/changed messages. 2015-05-18 12:39:00 +10:00
Tyson Clugg
6a447b5558 Fix pylint warning about local overwrite of variable. 2015-05-18 12:38:29 +10:00
Tyson Clugg
4fe0a0f858 Send nosub in response to bad sub request. 2015-05-18 12:37:09 +10:00
Tyson Clugg
bd830a4aab Fix change handler for objects updated using F expressions. 2015-05-18 12:35:52 +10:00
Tyson Clugg
ea440356a3 Show stack trace on console by default to further debugging efforts. 2015-05-18 12:34:30 +10:00
Tyson Clugg
28a187a574 Correct ordering of outgoing messages for RPC calls that should return result after change messages. 2015-05-12 08:53:21 +10:00
Tyson Clugg
c95e2faf2a Refactored send_notify to add custom serialization support. 2015-05-06 19:40:54 +10:00
Tyson Clugg
ba592bb0a0 Fix publications/collection DDP update routing to select the correct collection for change updates. 2015-04-29 19:54:53 +10:00
Tyson Clugg
9de6b8dc9d Add autoform options to /foo.collection/schema. 2015-04-29 19:47:39 +10:00
Tyson Clugg
223e425cde Stop wrapping api methods in transaction.atomic, they are already in transactions from websocket.py -> dispatch(). 2015-04-29 19:45:52 +10:00
Tyson Clugg
e8e0e2df98 Make live updates honour user_rel restrictions, also allow superusers to see everything. 2015-04-28 12:17:35 +10:00
Tyson Clugg
abe6b12ece Allow fresh connections from browsers that have not established a
session in the database yet, also allow subscriptions from
unauthenticated sessions (but don\'t show any data for collections that
have user_rel items defined).
2015-04-27 22:26:39 +10:00