1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Move local_now() to utilities.datetime

This commit is contained in:
Jeremy Stretch
2024-03-21 15:59:51 -04:00
parent 6ac700e43f
commit 7b1a08a187
4 changed files with 15 additions and 11 deletions

View File

@ -1,6 +1,4 @@
from django.db.models import ManyToOneRel
from django.utils import timezone
from django.utils.timezone import localtime
def dynamic_import(name):
@ -14,13 +12,6 @@ def dynamic_import(name):
return mod
def local_now():
"""
Return the current date & time in the system timezone.
"""
return localtime(timezone.now())
def get_related_models(model, ordered=True):
"""
Return a list of all models which have a ForeignKey to the given model and the name of the field. For example,