Skip to content

Instantly share code, notes, and snippets.

View stevelacey's full-sized avatar
🚀
Shipping

Steve Lacey stevelacey

🚀
Shipping
View GitHub Profile
@stevelacey
stevelacey / middleware.py
Last active May 10, 2024 15:05 — forked from mindlace/middleware.py
UserstampMiddleware
# -*- coding: utf-8 -*-
from django.db.models import signals
from django.utils.functional import curry
from rest_framework import authentication
class UserstampMiddleware(object):
"""Add user created_by and updated_by foreign key refs to any model automatically.
Almost entirely taken from https://github.com/Atomidata/django-audit-log/blob/master/audit_log/middleware.py"""
def process_request(self, request):
<?php
namespace Application\BaseBundle\Doctrine\Listener;
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
class InheritanceMapping
{
protected $mappings;