
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
django-datetimezone-field
Advanced tools
A Django app providing database and form fields for split datetime/time and pytz timezone objects.
Here is how it looks like__.
Written on top of django-timezone-field__.
A Django app providing database and form fields for split datetime/time and pytz timezone objects.
SplitDateTimeTimeZoneField in place of :code:forms.DateTimeField.SplitTimeTimeZoneField in place of :code:forms.TimeField.The setting :code:USE_TZ_FIELDS = True will convert all :code:admin.ModelAdmin to use :code:SplitDateTimeTimeZoneField for :code:models.DateTimeField and :code:SplitTimeTimeZoneField for :code:models.TimeField.
Requires :code:USE_TZ = True in :code:settings.py
If using a database that does not support timezone-aware times then the initial values of model forms will always be in the UTC timezone.
.. code:: python
import pytz
from django import http
from django import forms
from django.utils import timezone
from django.forms.util import to_current_timezone
from django.conf import settings
from datetimezone_field import SplitDateTimeTimeZoneField, \
SplitTimeTimeZoneField
def index(request):
class MyForm(forms.Form):
a_datetime = SplitDateTimeTimeZoneField()
a_time = SplitTimeTimeZoneField()
tz = pytz.timezone("Australia/Sydney")
timezone.activate(tz)
now = to_current_timezone(timezone.now()).replace(tzinfo=tz)
my_form = MyForm(initial={
'a_datetime': now,
'a_time': now.time().replace(tzinfo=now.tzinfo)
})
return http.HttpResponse(my_form.as_p())
#. From pypi__ using pip__:
.. code:: sh
pip install django-datetimezone-field
#. Add :code:timezone_field and :code:datetimezone_field to your :code:settings.INSTALLED_APPS
.. code:: python
INSTALLED_APPS = (
...
timezone_field,
datetimezone_field,
...
)
cd test/sample_projectvirtualenv sample-envsource sample-env/bin/activatepip install -r requirements.txtpython manage.py syncdbpython manage.py runserver#. Unit tests
To file a bug or submit a patch, please head over to django-datetimezone-field on github__.
Built on top of Mike Fogel's django-timezone-field__.
__ https://github.com/GradConnection/django-datetimezone-field/wiki/Screenshots __ https://github.com/mfogel/django-timezone-field/ __ http://pypi.python.org/pypi/django-datetimezone-field/ __ http://www.pip-installer.org/ __ https://github.com/mfogel/django-datetimezone-field/ __ https://github.com/mfogel/django-timezone-field/
FAQs
A Django app providing database and form fields for split datetime/time and pytz timezone objects.
We found that django-datetimezone-field demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.