Tyson Clugg
aa89ead1ed
Allow support for multiple meteor apps in a single django-ddp enabled project by reading METEOR_STAR_JSON as part of view init instead of app ready.
2015-07-23 11:07:20 +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
e7b38b89db
Stop running request middleware upon connection.
...
This change deserves a more thorough explanation. All currently
released versions of Django are based around the concept of receiving a
request and immediately dispatching a response.
WebSocket connections don't follow this convention, and the `request` hangs
around for long periods of time. As such, things like `request.user` don't
really make sense as a user may login, then logout, then login again all
within the life of a single request.
Given that the concepts applied in Django are based upon a premise that
doesn't hold true for WebSockets (that a request is short-lived), it
doesn't make sense to apply those concepts in django-ddp.
2015-07-21 21:24:14 +10:00
Tyson Clugg
d358ce413a
Never assume this.user_id is available.
2015-07-21 21:23:37 +10:00
Tyson Clugg
305b00bc3d
Add ThreadLocal factory for this.user which is retrieved from the datbase on demand.
2015-07-21 21:19:55 +10:00
Tyson Clugg
5088c0016d
Move thread local factories out of ThreadLocal so other modules may add their own factories.
2015-07-21 21:17:23 +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
a462fc52b6
Refactor dddp.accounts.ddp to not use this.request.user or any of django.contrib.sessions.
2015-07-21 19:00:07 +10:00
Tyson Clugg
adf8a5b9c3
Some pylint cleanups to dddp.accounts.ddp module.
2015-07-21 18:53:49 +10:00
Tyson Clugg
b059fe37da
Allow silent sub/unsub to support Meteor null publications.
2015-07-21 09:55:55 +10:00
Tyson Clugg
4608996e9f
Fix issue with incorrect ordering of messages during login/logout.
2015-07-18 14:09:50 +10:00
Tyson Clugg
8eb2a3d492
Add short_description to get_meteor_id helper for use in ModelAdmin list_display.
2015-07-17 17:49:23 +10:00
Tyson Clugg
797e10e08c
Add ObjectMappingMixin using GenericRelation back to ObjectMapping model.
2015-07-17 17:48:25 +10:00
Tyson Clugg
f43097a9ca
Add dddp.models.get_object_ids helper function.
2015-07-17 17:46:46 +10:00
Tyson Clugg
a9856294c0
Simplify ModelAdmin registration.
2015-07-16 16:26:53 +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
cb46caf9ff
Fix bug in post login/logout subscription handling.
2015-07-14 09:22:27 +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
b059dcbeb0
Fix bug in Accounts.forgotPassword implementation.
2015-07-08 11:55:41 +10:00
Tyson Clugg
fe13aac602
Match return values for Accounts.changePassword and Accounts.changePassword methods.
2015-07-08 11:33:18 +10:00
Yan
8eb293f090
update changePassword
2015-07-08 11:15:32 +10:00
Tyson Clugg
92b42e365b
Update hash method in dddp.accounts to bind hash tokens to specified purposes.
2015-07-07 17:40:07 +10:00
Yan
0076b729e4
fix incorrect params in reset_password
2015-07-07 14:22:55 +10:00
Tyson Clugg
ebc8be6e3b
Publish user.permissions from dddp.accounts.
2015-07-03 11:49:21 +10:00
Tyson Clugg
b73e29edae
Use mimetypes module to correctly guess mime types for Meteor files being served.
2015-06-29 18:19:07 +10:00
Tyson Clugg
35b8b001aa
Include ROOT_URL_PATH_PREFIX in ROOT_URL when serving Meteor build files.
2015-06-29 12:01:47 +10:00
Tyson Clugg
fd0cd2023a
Use HTTPS for DDP URL if settings.SECURE_SSL_REDIRECT is set.
2015-06-22 04:14:34 +10:00
Tyson Clugg
2f69881e14
Handle django.contrib.postgres.fields.ArrayField in serialization.
2015-06-16 17:50:10 +10:00
Tyson Clugg
34f862bb3d
Pylint cleanup.
2015-06-16 17:49:39 +10:00
Tyson Clugg
07ccc014bc
Fix array aggregate for Django 1.8
2015-06-14 03:31:27 +10:00
Tyson Clugg
9b18e4833a
Remove unused imports from AppConfig module.
2015-06-14 00:20:39 +10:00
Tyson Clugg
16e48e50be
Don't barf on multiple invocations of greenify().
2015-06-14 00:08:13 +10:00
Tyson Clugg
2ad5e28452
WIP on Django 1.8 compatibility.
2015-06-12 23:08:27 +10:00
Tyson Clugg
3cf47a928f
Remove editor cruft from repo.
2015-06-10 17:48:29 +10:00
Tyson Clugg
a680a5a643
Add dddp.server Django app to serve Meteor app files.
2015-06-05 09:51:54 +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
8327aac633
Use OrderedDict for geventwebsocket.Resource spec so geventwebsockets>=0.9.4 doesn't complain.
2015-05-27 15:16:07 +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
8252a1ce68
Move test projects into path that can be imported post install.
2015-05-27 08:55:46 +10:00
Tyson Clugg
469b3cc901
Add support for SSL options and --settings=SETTINGS arg in dddp tool.
2015-05-27 08:53:17 +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
5f43879f74
Login after create_user as per http://docs.meteor.com/#/full/accounts_createuser
2015-05-14 13:44:32 +10:00
Tyson Clugg
53ec18cd33
Add dddp.accounts module (Django application).
2015-05-12 14:35:08 +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
1e99b0c396
Gracefully handle poorly registered instance methods that take no args (ie: missing self arg)
2015-04-29 19:51:40 +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
1a91693d1f
Drop session field from Connection model, move transaction wrapper from on_message to dispatch handler.
2015-04-29 19:40:30 +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
8931025d53
Support serializing objects that are saved with F expressions by reading field values for F expressions from database explicitly before serializing.
2015-04-27 22:30:52 +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
Tyson Clugg
b6a4388b93
Move serializer factory into global thread context.
2015-04-27 10:29:00 +10:00
Tyson Clugg
86c8a68f88
Move dddp.main.greenify() to dddp.greenify() to avoid import of threading module before green thread init.
2015-04-23 13:50:33 +10:00
Tyson Clugg
b9a17b8f37
New DB field: Connection.server_addr, cleanup connections on shutdown.
2015-04-23 13:46:54 +10:00
Tyson Clugg
c20ad035f6
Add ability to deserialize DDP objects.
2015-04-23 13:24:13 +10:00
Tyson Clugg
befa57b8a3
Add dddp.models.get_object(model, meteor_id) method, make get_meteor_id(obj) return None where obj is None.
2015-04-23 10:02:13 +10:00
Tyson Clugg
756a65474d
Fix /schema method call.
2015-04-23 09:51:37 +10:00
Tyson Clugg
59cc3f0ad1
Fix unsubscribe from publications.
2015-04-23 09:50:45 +10:00
Tyson Clugg
5768d1ebcf
Fix non-threadsafe failure in serializer - now using thread local serializer instance.
2015-04-23 09:41:49 +10:00
Tyson Clugg
82ca99b142
Make dddp management command a subclass of the runserver command so that staticfiles works as expected.
2015-04-23 09:38:14 +10:00
Tyson Clugg
930dfc439a
Change DDP serializer to inherit most behaviours from default python serializer, with judicious use of super() where necessary.
2015-04-23 09:23:57 +10:00
Tyson Clugg
c52f2eac3c
Version 0.2.5: Fix foreign key references in change messages to correctly reference related object rather than source object.
2015-04-15 12:01:39 +10:00
Tyson Clugg
068422099f
Version 0.2.4 - Fix unicode rendering bug in DDP admin for ObjectMapping model.
2015-04-15 11:10:07 +10:00
Tyson Clugg
c40e8722bc
Add console script to start DDP service in more robust manner than using the dddp Django mangement command (bump version for release: 0.2.3).
2015-04-15 11:00:15 +10:00
Tyson Clugg
41c544dadb
Fix generation of meteor ID's to match meteor client implementation.
2015-04-14 11:08:08 +10:00
Tyson Clugg
7dea154d0d
Don't include null/None reply from method calls in message.
2015-04-14 10:51:53 +10:00
Tyson Clugg
feaea9f0c1
Change validation so that we now pass the DDP test suite < http://ddptest.meteor.com/ >.
2015-04-10 11:10:41 +10:00
Tyson Clugg
4a4cd729ea
Create subscriptions inside a transaction.
2015-04-10 11:09:22 +10:00
Tyson Clugg
e5979318e2
Remove unused site module.
2015-04-10 11:05:44 +10:00
Tyson Clugg
94a75dee8b
Django DDP version 0.2.0
2015-04-08 16:14:22 +10:00
Tyson Clugg
7c303c1a23
Add test_project, update dddp command to use port 8000 by default, new subscription model.
2015-03-16 15:03:35 +11:00
Tyson Clugg
90dc7facab
Connect using psycopg2 directly rather than via django.db.connection.get_new_connection(...) which doesn't do what we want in Django 1.7
2015-03-12 16:50:38 +11:00
Tyson Clugg
ab0d3ba161
Add gevent thread local support, Alea PRNG generator, refactor EJSON message generation, add ObjectMapping model.
2015-03-04 18:29:07 +11:00
Tyson Clugg
29b9acf8e4
Use logging rather than print statements, find WSGI_APPLICATION rather than using donor project default.
2015-02-25 08:12:56 +11:00
Tyson Clugg
25a9fe6ef3
Refactor dddp management command, breaking out PostgresGreenlet and DDPWebSocketApplication.
2015-02-24 16:59:34 +11:00
Tyson Clugg
88e6799ae2
Refactored server.py intoA dddp management command, added pub/sub capability (realtime), intial result sets... woo!
2015-02-24 11:43:46 +11:00
Tyson Clugg
a044326be0
A working proof-of-concept.
2015-02-23 15:29:18 +11:00