Assuming bare, untouched Windows 7 Ultimate x64
Install git
Clone repository
git clone https://github.com/GNOME-MouseTrap/mousetrap.git
Assuming bare, untouched Windows 7 Ultimate x64
Install git
Clone repository
git clone https://github.com/GNOME-MouseTrap/mousetrap.git
Over the summer we switched our workflow to include GitHub in order to help up facilitate the rewrite of MouseTrap. Now that the summer is over, we are left wondering how we should handle contributions to the project.
MouseTrap has had two main workflows during the time that I have been on the project.
import fileinput | |
import re | |
import sys | |
file_name = sys.argv[1] | |
new_file = sys.argv[2] | |
rh = open(file_name, "r") | |
lines = rh.readlines() | |
rh.close() |
# Do not include the browsable api renderer in the initial list of classes | |
if not DEBUG: | |
REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"] += [ | |
"rest_framework.renderers.BrowsableAPIRenderer", | |
] |
class CompatibleDispatchInitialization(object): | |
""" | |
Allow data to be initialized before a view is fully dispatched in a way | |
that is consistent across both standard Django views and Django REST | |
Framework views. | |
While initializing data would typically be done within `dispatch`, the | |
request is not fully initialized at that point during DRF views which | |
causes issues with authentication. For this reason, it is recommended to | |
do data initialization within the `initial` method for DRF views. The |
class DisablePaginationMixin(object): | |
def get_paginate_by(self, queryset=None): | |
if self.paginate_by_param in self.request.QUERY_PARAMS and \ | |
self.request.QUERY_PARAMS[self.paginate_by_param] == '0': | |
return None | |
return super(DisablePaginationMixin, self).get_paginate_by(queryset) |
DRF doesn't allow nested ViewSets natively, so I figured out the least amount of tweaks required to get it working.
The fields that are provided allow you to override the reverse() call with a specific mapping. These cannot be used across urls yet, as it pulls straight from the kwargs.
In your field, you must define map
, which is a dictionary of destinaton => previous kwargs keys. These keys are relative to the current URL.