(?<Current>^[A-Z]{2}[0-9]{2}[A-Z]{3}$)|(?<Prefix>^[A-Z][0-9]{1,3}[A-Z]{3}$)|(?<Suffix>^[A-Z]{3}[0-9]{1,3}[A-Z]$)|(?<DatelessLongNumberPrefix>^[0-9]{1,4}[A-Z]{1,2}$)|(?<DatelessShortNumberPrefix>^[0-9]{1,3}[A-Z]{1,3}$)|(?<DatelessLongNumberSuffix>^[A-Z]{1,2}[0-9]{1,4}$)|(?<DatelessShortNumberSufix>^[A-Z]{1,3}[0-9]{1,3}$)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Example model | |
| class User(Base): | |
| __tablename__ = 'user' | |
| @classmethod | |
| def _base_filters(self, obj): | |
| # Add this method to your model if you want base filtering, otherwise leave it out | |
| # import and_ from sqlalchemy package | |
| # this is a base filter for ALL queries | |
| return and_( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import datetime | |
| import json | |
| from django.contrib.auth.decorators import login_required | |
| from django.core.serializers.json import DjangoJSONEncoder | |
| from django.http import HttpResponse, HttpResponseForbidden | |
| from django.contrib import auth | |
| from django.contrib.auth import authenticate, login |