text stringlengths 81 112k |
|---|
Merge two entries that correspond to the same entry.
def merge_dupes(self):
"""Merge two entries that correspond to the same entry."""
for dupe in self.dupe_of:
if dupe in self.catalog.entries:
if self.catalog.entries[dupe]._stub:
# merge = False to avoid... |
Add an `Quantity` instance to this entry.
def add_quantity(self,
quantities,
value,
source,
check_for_dupes=True,
compare_to_existing=True,
**kwargs):
"""Add an `Quantity` instance to t... |
Add a source that refers to the catalog itself.
For now this points to the Open Supernova Catalog by default.
def add_self_source(self):
"""Add a source that refers to the catalog itself.
For now this points to the Open Supernova Catalog by default.
"""
return self.add_source(... |
Add a `Source` instance to this entry.
def add_source(self, allow_alias=False, **kwargs):
"""Add a `Source` instance to this entry."""
if not allow_alias and SOURCE.ALIAS in kwargs:
err_str = "`{}` passed in kwargs, this shouldn't happen!".format(
SOURCE.ALIAS)
s... |
Add a `Model` instance to this entry.
def add_model(self, allow_alias=False, **kwargs):
"""Add a `Model` instance to this entry."""
if not allow_alias and MODEL.ALIAS in kwargs:
err_str = "`{}` passed in kwargs, this shouldn't happen!".format(
SOURCE.ALIAS)
self.... |
Add a `Spectrum` instance to this entry.
def add_spectrum(self, compare_to_existing=True, **kwargs):
"""Add a `Spectrum` instance to this entry."""
spec_key = self._KEYS.SPECTRA
# Make sure that a source is given, and is valid (nor erroneous)
source = self._check_cat_dict_source(Spectru... |
Check that the entry has the required fields.
def check(self):
"""Check that the entry has the required fields."""
# Make sure there is a schema key in dict
if self._KEYS.SCHEMA not in self:
self[self._KEYS.SCHEMA] = self.catalog.SCHEMA.URL
# Make sure there is a name key in... |
Retrieve the aliases of this object as a list of strings.
Arguments
---------
includename : bool
Include the 'name' parameter in the list of aliases.
def get_aliases(self, includename=True):
"""Retrieve the aliases of this object as a list of strings.
Arguments
... |
Retrieve the raw text from a file.
def get_entry_text(self, fname):
"""Retrieve the raw text from a file."""
if fname.split('.')[-1] == 'gz':
with gz.open(fname, 'rt') as f:
filetext = f.read()
else:
with codecs.open(fname, 'r') as f:
file... |
Given an alias, find the corresponding source in this entry.
If the given alias doesn't exist (e.g. there are no sources), then a
`ValueError` is raised.
Arguments
---------
alias : str
The str-integer (e.g. '8') of the target source.
Returns
------... |
Get a new `Entry` which contains the 'stub' of this one.
The 'stub' is only the name and aliases.
Usage:
-----
To convert a normal entry into a stub (for example), overwrite the
entry in place, i.e.
>>> entries[name] = entries[name].get_stub()
Returns
-... |
Check if attribute has been marked as being erroneous.
def is_erroneous(self, field, sources):
"""Check if attribute has been marked as being erroneous."""
if self._KEYS.ERRORS in self:
my_errors = self[self._KEYS.ERRORS]
for alias in sources.split(','):
source =... |
Check if attribute is private.
def is_private(self, key, sources):
"""Check if attribute is private."""
# aliases are always public.
if key == ENTRY.ALIAS:
return False
return all([
SOURCE.PRIVATE in self.get_source_by_alias(x)
for x in sources.split(... |
Sanitize the data (sort it, etc.) before writing it to disk.
Template method that can be overridden in each catalog's subclassed
`Entry` object.
def sanitize(self):
"""Sanitize the data (sort it, etc.) before writing it to disk.
Template method that can be overridden in each catalog's... |
Write entry to JSON file in the proper location.
Arguments
---------
bury : bool
final : bool
If this is the 'final' save, perform additional sanitization and
cleaning operations.
def save(self, bury=False, final=False):
"""Write entry to JSON file in t... |
Used to sort keys when writing Entry to JSON format.
Should be supplemented/overridden by inheriting classes.
def sort_func(self, key):
"""Used to sort keys when writing Entry to JSON format.
Should be supplemented/overridden by inheriting classes.
"""
if key == self._KEYS.SCH... |
Set photometry dictionary from a counts measurement.
def set_pd_mag_from_counts(photodict,
c='',
ec='',
lec='',
uec='',
zp=DEFAULT_ZP,
sig=DEFAULT_UL_SIGMA):... |
Set photometry dictionary from a flux density measurement.
`fd` is assumed to be in microjanskys.
def set_pd_mag_from_flux_density(photodict,
fd='',
efd='',
lefd='',
uefd='',
... |
Check that entry attributes are legal.
def _check(self):
"""Check that entry attributes are legal."""
# Run the super method
super(Photometry, self)._check()
err_str = None
has_flux = self._KEYS.FLUX in self
has_flux_dens = self._KEYS.FLUX_DENSITY in self
has_u_... |
Specify order for attributes.
def sort_func(self, key):
"""Specify order for attributes."""
if key == self._KEYS.TIME:
return 'aaa'
if key == self._KEYS.MODEL:
return 'zzy'
if key == self._KEYS.SOURCE:
return 'zzz'
return key |
Run migrations in 'offline' mode.
This configures the context with just a URL
and not an Engine, though an Engine is acceptable
here as well. By skipping the Engine creation
we don't even need a DBAPI to be available.
Calls to context.execute() here emit the given string to the
script output.... |
Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
def run_migrations_online():
"""Run migrations in 'online' mode.
In this scenario we need to create an Engine
and associate a connection with the context.
"""
engine... |
return all instances by user name, perm name and resource id
:param user_id:
:param perm_name:
:param resource_id:
:param db_session:
:return:
def by_resource_user_and_perm(
cls, user_id, perm_name, resource_id, db_session=None
):
"""
return all inst... |
Get the next sensor while iterating.
:return: a dict with the keys: protocol, model, id, datatypes.
def tdSensor(self):
"""Get the next sensor while iterating.
:return: a dict with the keys: protocol, model, id, datatypes.
"""
protocol = create_string_buffer(20)
model ... |
Get the sensor value for a given sensor.
:return: a dict with the keys: value, timestamp.
def tdSensorValue(self, protocol, model, sid, datatype):
"""Get the sensor value for a given sensor.
:return: a dict with the keys: value, timestamp.
"""
value = create_string_buffer(20)
... |
Get the next controller while iterating.
:return: a dict with the keys: id, type, name, available.
def tdController(self):
"""Get the next controller while iterating.
:return: a dict with the keys: id, type, name, available.
"""
cid = c_int()
ctype = c_int()
na... |
schemes contains a list of replace this list with the hash(es) you wish
to support.
this example sets pbkdf2_sha256 as the default,
with support for legacy bcrypt hashes.
:param schemes:
:return: CryptContext()
def make_passwordmanager(schemes=None):
"""
schemes contains a list of replace ... |
This function handles attaching model to service if model has one specified
as `_ziggurat_service`, Also attached a proxy object holding all model
definitions that services might use
:param args:
:param kwargs:
:param passwordmanager, the password manager to override default one
:param password... |
Show messages for the given query or day.
def messages(request, year=None, month=None, day=None,
template="gnotty/messages.html"):
"""
Show messages for the given query or day.
"""
query = request.REQUEST.get("q")
prev_url, next_url = None, None
messages = IRCMessage.objects.all()... |
Show calendar months for the given year/month.
def calendar(request, year=None, month=None, template="gnotty/calendar.html"):
"""
Show calendar months for the given year/month.
"""
try:
year = int(year)
except TypeError:
year = datetime.now().year
lookup = {"message_time__year"... |
A helper for decorating :class:`bravado.client.SwaggerClient`.
:class:`bravado.client.SwaggerClient` can be extended by creating a class
which wraps all calls to it. This helper is used in a :func:`__getattr__`
to check if the attr exists on the api_client. If the attr does not exist
raise :class:`Attri... |
Deletes all expired mutex locks if a ttl is provided.
def delete_expired_locks(self):
"""
Deletes all expired mutex locks if a ttl is provided.
"""
ttl_seconds = self.get_mutex_ttl_seconds()
if ttl_seconds is not None:
DBMutex.objects.filter(creation_time__lte=timezo... |
Acquires the db mutex lock. Takes the necessary steps to delete any stale locks.
Throws a DBMutexError if it can't acquire the lock.
def start(self):
"""
Acquires the db mutex lock. Takes the necessary steps to delete any stale locks.
Throws a DBMutexError if it can't acquire the lock.
... |
Releases the db mutex lock. Throws an error if the lock was released before the function finished.
def stop(self):
"""
Releases the db mutex lock. Throws an error if the lock was released before the function finished.
"""
if not DBMutex.objects.filter(id=self.lock.id).exists():
... |
Decorates a function with the db_mutex decorator by using this class as a context manager around
it.
def decorate_callable(self, func):
"""
Decorates a function with the db_mutex decorator by using this class as a context manager around
it.
"""
def wrapper(*args, **kwarg... |
Default groupfinder implementaion for pyramid applications
:param userid:
:param request:
:return:
def groupfinder(userid, request):
"""
Default groupfinder implementaion for pyramid applications
:param userid:
:param request:
:return:
"""
if userid and hasattr(request, "user"... |
Position nodes using ForceAtlas2 force-directed algorithm
Parameters
----------
graph: NetworkX graph
A position will be assigned to every node in G.
pos_list : dict or None optional (default=None)
Initial positions for nodes as a dictionary with node as keys
and values as a c... |
Iterate through the nodes or edges and apply the forces directly to the node objects.
def apply_repulsion(repulsion, nodes, barnes_hut_optimize=False, region=None, barnes_hut_theta=1.2):
"""
Iterate through the nodes or edges and apply the forces directly to the node objects.
"""
if not barnes_hut_opti... |
Iterate through the nodes or edges and apply the gravity directly to the node objects.
def apply_gravity(repulsion, nodes, gravity, scaling_ratio):
"""
Iterate through the nodes or edges and apply the gravity directly to the node objects.
"""
for i in range(0, len(nodes)):
repulsion.apply_gravi... |
Fetch row using primary key -
will use existing object in session if already present
:param external_id:
:param local_user_id:
:param provider_name:
:param db_session:
:return:
def get(cls, external_id, local_user_id, provider_name, db_session=None):
"""
... |
Returns ExternalIdentity instance based on search params
:param external_id:
:param provider_name:
:param db_session:
:return: ExternalIdentity
def by_external_id_and_provider(cls, external_id, provider_name, db_session=None):
"""
Returns ExternalIdentity instance based... |
Returns User instance based on search params
:param external_id:
:param provider_name:
:param db_session:
:return: User
def user_by_external_id_and_provider(
cls, external_id, provider_name, db_session=None
):
"""
Returns User instance based on search params... |
return by user and permission name
:param user_id:
:param perm_name:
:param db_session:
:return:
def by_user_and_perm(cls, user_id, perm_name, db_session=None):
"""
return by user and permission name
:param user_id:
:param perm_name:
:param db_s... |
Checks if cls node has parent with subclass_name.
def node_is_subclass(cls, *subclass_names):
"""Checks if cls node has parent with subclass_name."""
if not isinstance(cls, (ClassDef, Instance)):
return False
# if cls.bases == YES:
# return False
for base_cls in cls.bases:
try:... |
Checks if a call to a field instance method is valid. A call is
valid if the call is a method of the underlying type. So, in a StringField
the methods from str are valid, in a ListField the methods from list are
valid and so on...
def is_field_method(node):
"""Checks if a call to a field instance metho... |
Supposes that node is a mongoengine field in a class and tries to
get its parent class
def get_node_parent_class(node):
"""Supposes that node is a mongoengine field in a class and tries to
get its parent class"""
while node.parent: # pragma no branch
if isinstance(node, ClassDef):
... |
node is a class attribute that is a mongoengine. Returns
the definition statement for the attribute
def get_field_definition(node):
""""node is a class attribute that is a mongoengine. Returns
the definition statement for the attribute
"""
name = node.attrname
cls = get_node_parent_class(nod... |
Returns de ClassDef for the related embedded document in a
embedded document field.
def get_field_embedded_doc(node):
"""Returns de ClassDef for the related embedded document in a
embedded document field."""
definition = get_field_definition(node)
cls_name = definition.last_child().last_child()
... |
Checks if a node is a valid field or method in a embedded document.
def node_is_embedded_doc_attr(node):
"""Checks if a node is a valid field or method in a embedded document.
"""
embedded_doc = get_field_embedded_doc(node.last_child())
name = node.attrname
try:
r = bool(embedded_doc.lookup... |
This is the method in ``SimpleIRCClient`` that all IRC events
get passed through. Here we map events to our own custom
event handlers, and call them.
def _dispatcher(self, connection, event):
"""
This is the method in ``SimpleIRCClient`` that all IRC events
get passed through. H... |
We won't receive our own messages, so log them manually.
def message_channel(self, message):
"""
We won't receive our own messages, so log them manually.
"""
self.log(None, message)
super(BaseBot, self).message_channel(message) |
Log any public messages, and also handle the command event.
def on_pubmsg(self, connection, event):
"""
Log any public messages, and also handle the command event.
"""
for message in event.arguments():
self.log(event, message)
command_args = filter(None, message.... |
Command handler - treats each word in the message
that triggered the command as an argument to the command,
and does some validation to ensure that the number of
arguments match.
def handle_command_event(self, event, command, args):
"""
Command handler - treats each word in the ... |
Runs each timer handler in a separate greenlet thread.
def handle_timer_event(self, handler):
"""
Runs each timer handler in a separate greenlet thread.
"""
while True:
handler(self)
sleep(handler.event.args["seconds"]) |
Webhook handler - each handler for the webhook event
takes an initial pattern argument for matching the URL
requested. Here we match the URL to the pattern for each
webhook handler, and bail out if it returns a response.
def handle_webhook_event(self, environ, url, params):
"""
... |
Create the correct device instance based on device type and return it.
:return: a :class:`Device` or :class:`DeviceGroup` instance.
def DeviceFactory(id, lib=None):
"""Create the correct device instance based on device type and return it.
:return: a :class:`Device` or :class:`DeviceGroup` instance.
"... |
Dispatch a single callback in the current thread.
:param boolean block: If True, blocks waiting for a callback to come.
:return: True if a callback was processed; otherwise False.
def process_callback(self, block=True):
"""Dispatch a single callback in the current thread.
:param boole... |
Return all known devices.
:return: list of :class:`Device` or :class:`DeviceGroup` instances.
def devices(self):
"""Return all known devices.
:return: list of :class:`Device` or :class:`DeviceGroup` instances.
"""
devices = []
count = self.lib.tdGetNumberOfDevices()
... |
Return all known sensors.
:return: list of :class:`Sensor` instances.
def sensors(self):
"""Return all known sensors.
:return: list of :class:`Sensor` instances.
"""
sensors = []
try:
while True:
sensor = self.lib.tdSensor()
... |
Return all known controllers.
Requires Telldus core library version >= 2.1.2.
:return: list of :class:`Controller` instances.
def controllers(self):
"""Return all known controllers.
Requires Telldus core library version >= 2.1.2.
:return: list of :class:`Controller` instance... |
Add a new device.
:return: a :class:`Device` or :class:`DeviceGroup` instance.
def add_device(self, name, protocol, model=None, **parameters):
"""Add a new device.
:return: a :class:`Device` or :class:`DeviceGroup` instance.
"""
device = Device(self.lib.tdAddDevice(), lib=self... |
Add a new device group.
:return: a :class:`DeviceGroup` instance.
def add_group(self, name, devices):
"""Add a new device group.
:return: a :class:`DeviceGroup` instance.
"""
device = self.add_device(name, "group")
device.add_to_group(devices)
return device |
Connect a controller.
def connect_controller(self, vid, pid, serial):
"""Connect a controller."""
self.lib.tdConnectTellStickController(vid, pid, serial) |
Disconnect a controller.
def disconnect_controller(self, vid, pid, serial):
"""Disconnect a controller."""
self.lib.tdDisconnectTellStickController(vid, pid, serial) |
Get dict with all set parameters.
def parameters(self):
"""Get dict with all set parameters."""
parameters = {}
for name in self.PARAMETERS:
try:
parameters[name] = self.get_parameter(name)
except AttributeError:
pass
return parame... |
Get a parameter.
def get_parameter(self, name):
"""Get a parameter."""
default_value = "$%!)(INVALID)(!%$"
value = self.lib.tdGetDeviceParameter(self.id, name, default_value)
if value == default_value:
raise AttributeError(name)
return value |
Set a parameter.
def set_parameter(self, name, value):
"""Set a parameter."""
self.lib.tdSetDeviceParameter(self.id, name, str(value)) |
Add device(s) to the group.
def add_to_group(self, devices):
"""Add device(s) to the group."""
ids = {d.id for d in self.devices_in_group()}
ids.update(self._device_ids(devices))
self._set_group(ids) |
Remove device(s) from the group.
def remove_from_group(self, devices):
"""Remove device(s) from the group."""
ids = {d.id for d in self.devices_in_group()}
ids.difference_update(self._device_ids(devices))
self._set_group(ids) |
Fetch list of devices in group.
def devices_in_group(self):
"""Fetch list of devices in group."""
try:
devices = self.get_parameter('devices')
except AttributeError:
return []
ctor = DeviceFactory
return [ctor(int(x), lib=self.lib) for x in devices.split... |
Return the :class:`SensorValue` for the given data type.
sensor.value(TELLSTICK_TEMPERATURE) is identical to calling
sensor.temperature().
def value(self, datatype):
"""Return the :class:`SensorValue` for the given data type.
sensor.value(TELLSTICK_TEMPERATURE) is identical to calling... |
Move any off curves at the end of the contour
to the beginning of the contour. This makes
segmentation easier.
def _prepPointsForSegments(points):
"""
Move any off curves at the end of the contour
to the beginning of the contour. This makes
segmentation easier.
"""
while 1:
poin... |
Reverse the points. This differs from the
reversal point pen in RoboFab in that it doesn't
worry about maintaing the start point position.
That has no benefit within the context of this module.
def _reversePoints(points):
"""
Reverse the points. This differs from the
reversal point pen in RoboF... |
Compile points into InputSegment objects.
def _convertPointsToSegments(points, willBeReversed=False):
"""
Compile points into InputSegment objects.
"""
# get the last on curve
previousOnCurve = None
for point in reversed(points):
if point.segmentType is not None:
previousOnC... |
Finds a t value on a curve from a point.
The points must be originaly be a point on the curve.
This will only back trace the t value, needed to split the curve in parts
def _tValueForPointOnCubicCurve(point, cubicCurve, isHorizontal=0):
"""
Finds a t value on a curve from a point.
The points must b... |
Scale points and optionally convert them to integers.
def _scalePoints(points, scale=1, convertToInteger=True):
"""
Scale points and optionally convert them to integers.
"""
if convertToInteger:
points = [
(int(round(x * scale)), int(round(y * scale)))
for (x, y) in poin... |
Scale a single point
def _scaleSinglePoint(point, scale=1, convertToInteger=True):
"""
Scale a single point
"""
x, y = point
if convertToInteger:
return int(round(x * scale)), int(round(y * scale))
else:
return (x * scale, y * scale) |
Flatten the curve segment int a list of points.
The first and last points in the segment must be
on curves. The returned list of points will not
include the first on curve point.
false curves (where the off curves are not any
different from the on curves) must not be sent here.
duplicate points ... |
Estimate the length of this curve by iterating
through it and averaging the length of the flat bits.
def _estimateCubicCurveLength(pt0, pt1, pt2, pt3, precision=10):
"""
Estimate the length of this curve by iterating
through it and averaging the length of the flat bits.
"""
points = []
leng... |
(Point, Point) -> Point
Return the point that lies in between the two input points.
def _mid(pt1, pt2):
"""
(Point, Point) -> Point
Return the point that lies in between the two input points.
"""
(x0, y0), (x1, y1) = pt1, pt2
return 0.5 * (x0 + x1), 0.5 * (y0 + y1) |
Split the segment according the t values
def split(self, tValues):
"""
Split the segment according the t values
"""
if self.segmentType == "curve":
on1 = self.previousOnCurve
off1 = self.points[0].coordinates
off2 = self.points[1].coordinates
... |
get a t values for a given point
required:
the point must be a point on the curve.
in an overlap cause the point will be an intersection points wich is alwasy a point on the curve
def tValueForPoint(self, point):
"""
get a t values for a given point
required:
... |
Return a list of normalized InputPoint objects
for the contour drawn with this pen.
def getData(self):
"""
Return a list of normalized InputPoint objects
for the contour drawn with this pen.
"""
# organize the points into segments
# 1. make sure there is an on cu... |
Match if entire input contour matches entire output contour,
allowing for different start point.
def reCurveFromEntireInputContour(self, inputContour):
"""
Match if entire input contour matches entire output contour,
allowing for different start point.
"""
if self.clockw... |
Checks if a function definition is a queryset manager created
with the @queryset_manager decorator.
def _is_custom_qs_manager(funcdef):
"""Checks if a function definition is a queryset manager created
with the @queryset_manager decorator."""
decors = getattr(funcdef, 'decorators', None)
if decors:... |
Checks if the call is being done to a custom queryset manager.
def _is_call2custom_manager(node):
"""Checks if the call is being done to a custom queryset manager."""
called = safe_infer(node.func)
funcdef = getattr(called, '_proxied', None)
return _is_custom_qs_manager(funcdef) |
Checks if the attribute is a valid attribute for a queryset manager.
def _is_custom_manager_attribute(node):
"""Checks if the attribute is a valid attribute for a queryset manager.
"""
attrname = node.attrname
if not name_is_from_qs(attrname):
return False
for attr in node.get_children():... |
return by by_user_and_perm and permission name
:param group_id:
:param perm_name:
:param db_session:
:return:
def by_group_and_perm(cls, group_id, perm_name, db_session=None):
"""
return by by_user_and_perm and permission name
:param group_id:
:param pe... |
Starts the gevent-socketio server.
def serve_forever(django=False):
"""
Starts the gevent-socketio server.
"""
logger = getLogger("irc.dispatch")
logger.setLevel(settings.LOG_LEVEL)
logger.addHandler(StreamHandler())
app = IRCApplication(django)
server = SocketIOServer((settings.HTTP_HO... |
Attempts to shut down a previously started daemon.
def kill(pid_file):
"""
Attempts to shut down a previously started daemon.
"""
try:
with open(pid_file) as f:
os.kill(int(f.read()), 9)
os.remove(pid_file)
except (IOError, OSError):
return False
return True |
CLI entry point. Parses args and starts the gevent-socketio server.
def run():
"""
CLI entry point. Parses args and starts the gevent-socketio server.
"""
settings.parse_args()
pid_name = "gnotty-%s-%s.pid" % (settings.HTTP_HOST, settings.HTTP_PORT)
pid_file = settings.PID_FILE or os.path.join(... |
A WebSocket session has started - create a greenlet to host
the IRC client, and start it.
def on_start(self, host, port, channel, nickname, password):
"""
A WebSocket session has started - create a greenlet to host
the IRC client, and start it.
"""
self.client = WebSocke... |
WebSocket was disconnected - leave the IRC channel.
def disconnect(self, *args, **kwargs):
"""
WebSocket was disconnected - leave the IRC channel.
"""
quit_message = "%s %s" % (settings.GNOTTY_VERSION_STRING,
settings.GNOTTY_PROJECT_URL)
self.cl... |
Thread (greenlet) that will try and reconnect the bot if
it's not connected.
def bot_watcher(self):
"""
Thread (greenlet) that will try and reconnect the bot if
it's not connected.
"""
default_interval = 5
interval = default_interval
while True:
... |
Passes the request onto a bot with a webhook if the webhook
path is requested.
def respond_webhook(self, environ):
"""
Passes the request onto a bot with a webhook if the webhook
path is requested.
"""
request = FieldStorage(fp=environ["wsgi.input"], environ=environ)
... |
Serves a static file when Django isn't being used.
def respond_static(self, environ):
"""
Serves a static file when Django isn't being used.
"""
path = os.path.normpath(environ["PATH_INFO"])
if path == "/":
content = self.index()
content_type = "text/html... |
Loads the chat interface template when Django isn't being
used, manually dealing with the Django template bits.
def index(self):
"""
Loads the chat interface template when Django isn't being
used, manually dealing with the Django template bits.
"""
root_dir = os.path.dir... |
If we're running Django and ``GNOTTY_LOGIN_REQUIRED`` is set
to ``True``, pull the session cookie from the environment and
validate that the user is authenticated.
def authorized(self, environ):
"""
If we're running Django and ``GNOTTY_LOGIN_REQUIRED`` is set
to ``True``, pull t... |
Write your forwards methods here.
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
if not db.dry_run:
orm['gnotty.IRCMessage'].objects.filter(message="joins").update(join_or_leave=True)... |
Returns permission tuples that match one of passed permission names
perm_names - list of permissions that can be matched
user_ids - restrict to specific users
group_ids - restrict to specific groups
resource_ids - restrict to specific resources
limit_group_permissions - should be used if we do not w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.