refactor generic url creation

This commit is contained in:
vabene1111
2020-03-17 17:23:39 +01:00
parent 09ff7e82f1
commit 17b9519fa9
12 changed files with 53 additions and 52 deletions

View File

@ -1,8 +1,14 @@
import re
from django.contrib.auth.models import User
from django.utils.translation import gettext as _
from django.db import models
def get_model_name(model):
return ('_'.join(re.findall('[A-Z][^A-Z]*', model.__name__))).lower()
class UserPreference(models.Model):
# Themes
BOOTSTRAP = 'BOOTSTRAP'