How to use the gridcal.models.Group.objects function in GridCal

To help you get started, weā€™ve selected a few GridCal examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wikical / grical / gridcal / functions.py View on Github external
def is_event_viewable_by_user(event_id, user_id):
    event = Event.objects.get(id=event_id)
    if event.public_view:
        return True
    elif event.user == None:
        return True
    elif event.user.id == user_id:
        return True
    else:
        # iterating over all groups that the event belongs to
        for g in Group.objects.filter(events__id__exact=event_id):
            if is_user_in_group(user_id, g.id):
                return True
        return False

GridCal

GridCal is a Power Systems simulation program intended for professional use and research

LGPL-3.0
Latest version published 17 days ago

Package Health Score

78 / 100
Full package analysis

Similar packages