Did I find the right examples for you? yes no

All Samples(13)  |  Call(9)  |  Derive(0)  |  Import(4)

        def now_rounded():
    now = datetime.now()
    return datetime(now.year, now.month, now.day, now.hour, now.minute, 0, 0)
        


src/a/p/apidev-sanza-3.0.4/sanza/Emailing/views.py   apidev-sanza(Download)
from utils import send_verification_email
from sanza.utils import logger, log_error
from sanza.utils import now_rounded
import os.path
from django.core.servers.basehttp import FileWrapper
        link_action, _is_new = ActionType.objects.get_or_create(name=_(u'Link'))
        action = Action.objects.create(
            subject=link.url, planned_date=now_rounded(),
            type=link_action, detail='', done=True, display_on_board=False,
            done_date=now_rounded()
                action = Action.objects.create(
                    subject=_(u'{0} has unregister').format(contact),
                    planned_date=now_rounded(), type = emailing_action, detail=form.cleaned_data['reason'],
                    done=True, display_on_board=False, done_date=now_rounded()
                )

src/a/p/apidev-sanza-3.0.4/sanza/Profile/utils.py   apidev-sanza(Download)
from sanza.Crm import settings as crm_settings
from django.conf import settings
from sanza.utils import now_rounded
 
def create_profile_contact(user):
                subject = _(u"A user have registred with email {0} used by several other contacts".format(user.email)),
                type = at,
                planned_date = now_rounded(),
                detail = _(u'You should check that this contact is not duplicated'),
                display_on_board = True
        subject = _(u"Create an account on web site"),
        type = at,
        planned_date = now_rounded(),
        display_on_board = False,
        done = True

src/a/p/apidev-sanza-3.0.4/sanza/Profile/views.py   apidev-sanza(Download)
from django.template.loader import get_template
from models import ContactProfile
from sanza.utils import now_rounded
from registration.backends.default.views import RegistrationView, ActivationView
from forms import UserRegistrationForm
            message_action, _is_new = ActionType.objects.get_or_create(name=_(u'Message'))
            action = Action.objects.create(
                subject=_(u"New message on web site"), planned_date=now_rounded(),
                type = message_action, detail=message, contact=profile.contact, display_on_board=True
            )

src/a/p/apidev-sanza-3.0.4/sanza/Crm/models.py   apidev-sanza(Download)
from django.db.models.signals import post_save
from django.utils.html import mark_safe
from sanza.utils import now_rounded
from django.contrib.contenttypes.generic import GenericRelation
from sanza.Users.models import Favorite
    def save(self, *args, **kwargs):
        if not self.done_date and self.done:
            self.done_date = now_rounded()
        elif self.done_date and not self.done:
            self.done_date = None