Giter Site home page Giter Site logo

TimeProperty about graphene-gae HOT 3 CLOSED

graphql-python avatar graphql-python commented on June 27, 2024
TimeProperty

from graphene-gae.

Comments (3)

Emsu avatar Emsu commented on June 27, 2024 1

@ekampf created PR #37 for this

from graphene-gae.

Emsu avatar Emsu commented on June 27, 2024

@syrusakbary so far the above is working for me. Might be nice to add it in since it's an NDB supported property. Or I could open a PR with the one line change?

from graphene-gae.

Emsu avatar Emsu commented on June 27, 2024

Just listing what ended up doing

diff --git a/api/lib/graphene_gae/ndb/converter.py b/api/lib/graphene_gae/ndb/converter.py
index 2450cd7..d580c06 100644
--- a/api/lib/graphene_gae/ndb/converter.py
+++ b/api/lib/graphene_gae/ndb/converter.py
@@ -6,7 +6,7 @@ from google.appengine.ext import ndb

 from graphene import String, Boolean, Int, Float, List, NonNull, Field, Dynamic
 from graphene.types.json import JSONString
-from graphene.types.datetime import DateTime
+from graphene.types.datetime import DateTime, Time

 from .fields import DynamicNdbKeyStringField, DynamicNdbKeyReferenceField

@@ -60,6 +60,10 @@ def convert_ndb_datetime_property(ndb_prop):
     return Field(DateTime, description=ndb_prop._name)


+def convert_ndb_time_property(ndb_prop):
+    return Field(Time, description=ndb_prop._name)
+
+
 def convert_ndb_key_propety(ndb_key_prop):
     """
     Two conventions for handling KeyProperties:
@@ -135,6 +139,7 @@ converters = {
     ndb.FloatProperty: convert_ndb_float_property,
     ndb.JsonProperty: convert_ndb_json_property,
     ndb.DateProperty: convert_ndb_datetime_property,
+    ndb.TimeProperty: convert_ndb_time_property,
     ndb.DateTimeProperty: convert_ndb_datetime_property,
     ndb.KeyProperty: convert_ndb_key_propety,
     ndb.StructuredProperty: convert_local_structured_property,

from graphene-gae.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.