On Oct 26, 7:00 am, Giacecco <[EMAIL PROTECTED]> wrote:
> Very simple problem:
>
>    from datetime import strftime
>
> gives me this error
>
>    ImportError at /
>    cannot import name strftime

Giacecco:

It's working fine on some code I have here, that uses strftime()
directly on a datetime property:

from google.appengine.ext import db

from owner import Owner


class Bookmark(db.Model):
  description = db.StringProperty()
  favIcon     = db.LinkProperty()
  locator     = db.LinkProperty()
  timeStamp   = db.DateTimeProperty(auto_now_add = True)
  title       = db.StringProperty()
  owner       = db.ReferenceProperty(Owner,
      collection_name = 'bookmarks')
  # <snip>

  @property
  def dateTimeText(self):
    return self.timeStamp.strftime("%Y.%m.%d")

That method call is available in the underlying datetime object
without having to import anything.

I hope this helps and cheers,

pr3d4t0r
http://www.istheserverup.com
http://www.teslatestament.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to