Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for isoformat (0.18 sec)

  1. tests/test_serialize_response_dataclass.py

                "date": datetime(2021, 7, 26).isoformat(),
                "price": None,
                "owner_ids": None,
            },
            {
                "name": "bar",
                "date": datetime(2021, 7, 26).isoformat(),
                "price": 1.0,
                "owner_ids": None,
            },
            {
                "name": "baz",
                "date": datetime(2021, 7, 26).isoformat(),
                "price": 2.0,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Aug 26 13:56:47 GMT 2022
    - 4.9K bytes
    - Viewed (0)
  2. fastapi/encoders.py

        else:
            return float(dec_value)
    
    
    ENCODERS_BY_TYPE: Dict[Type[Any], Callable[[Any], Any]] = {
        bytes: lambda o: o.decode(),
        Color: str,
        datetime.date: isoformat,
        datetime.datetime: isoformat,
        datetime.time: isoformat,
        datetime.timedelta: lambda td: td.total_seconds(),
        Decimal: decimal_encoder,
        Enum: lambda o: o.value,
        frozenset: list,
        deque: list,
        GeneratorType: list,
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 10.8K bytes
    - Viewed (0)
  3. tests/test_datetime_custom_encoder.py

            dt_field: datetime
    
            @field_serializer("dt_field")
            def serialize_datetime(self, dt_field: datetime):
                return dt_field.replace(microsecond=0, tzinfo=timezone.utc).isoformat()
    
        app = FastAPI()
        model = ModelWithDatetimeField(dt_field=datetime(2019, 1, 1, 8))
    
        @app.get("/model", response_model=ModelWithDatetimeField)
        def get_model():
            return model
    
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  4. tests/test_jsonable_encoder.py

        instance = MyModel(dt_field=safe_datetime.now())
    
        encoded_instance = jsonable_encoder(
            instance, custom_encoder={safe_datetime: lambda o: o.isoformat()}
        )
        assert encoded_instance["dt_field"] == instance.dt_field.isoformat()
    
    
    def test_custom_enum_encoders():
        def custom_enum_encoder(v: Enum):
            return v.value.lower()
    
        class MyEnum(Enum):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 9K bytes
    - Viewed (0)
  5. docs/sts/client_grants/__init__.py

                    secret_key=creds.get_child_text('SecretAccessKey'),
                    token=creds.get_child_text('SessionToken'),
                    expiry_time=parse(creds.get_child_text('Expiration')).isoformat())
    
    Python
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 4.6K bytes
    - Viewed (1)
  6. ci/official/utilities/extract_resultstore_links.py

      failure_count = 0
      error_count = 0
    
      date_time = datetime.datetime
      attrib = {'name': 'Bazel Invocations', 'time': '0.0',
                'timestamp': date_time.isoformat(date_time.utcnow())}
      testsuites = ElemTree.Element('testsuites')
      testsuite = ElemTree.SubElement(testsuites, 'testsuite')
      for url, invocation_results in result_store_dict.items():
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Wed Nov 08 17:50:27 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  7. internal/s3select/select.go

    )
    
    type recordReader interface {
    	// Read a record.
    	// dst is optional but will be used if valid.
    	Read(dst sql.Record) (sql.Record, error)
    	Close() error
    }
    
    const (
    	csvFormat     = "csv"
    	jsonFormat    = "json"
    	parquetFormat = "parquet"
    )
    
    // CompressionType - represents value inside <CompressionType/> in request XML.
    type CompressionType string
    
    const (
    	noneType  CompressionType = "none"
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Nov 06 22:26:08 GMT 2023
    - 21K bytes
    - Viewed (0)
  8. istioctl/pkg/util/formatting/formatter.go

    	"istio.io/istio/pkg/config/analysis/diag"
    	"istio.io/istio/pkg/env"
    )
    
    // Formatting options for Messages
    const (
    	LogFormat  = "log"
    	JSONFormat = "json"
    	YAMLFormat = "yaml"
    )
    
    var (
    	MsgOutputFormatKeys = []string{LogFormat, JSONFormat, YAMLFormat}
    	MsgOutputFormats    = make(map[string]bool)
    	termEnvVar          = env.Register("TERM", "", "Specifies terminal type.  Use 'dumb' to suppress color output")
    )
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Jul 11 02:41:45 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  9. istioctl/pkg/util/formatting/formatter_test.go

    		diag.NewMessageType(diag.Warning, "C1", "Collapse danger: %v"),
    		diag.MockResource("GrandCastle"),
    		"the castle is too old",
    	)
    
    	msgs := diag.Messages{firstMsg, secondMsg}
    	output, _ := Print(msgs, JSONFormat, false)
    
    	expectedOutput := `[
    	{
    		"code": "B1",
    		"documentationUrl": "` + url.ConfigAnalysis + `/b1/",
    		"level": "Error",
    		"message": "Explosion accident: the bubble is too big",
    		"origin": "SoapBubble"
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Oct 31 14:48:28 GMT 2023
    - 4.1K bytes
    - Viewed (0)
  10. istioctl/pkg/util/constants.go

    )
    
    const (
    	// ExperimentalMsg indicate active development and not for production use warning.
    	ExperimentalMsg = `THIS COMMAND IS UNDER ACTIVE DEVELOPMENT AND NOT READY FOR PRODUCTION USE.`
    )
    
    const (
    	JSONFormat  = "json"
    	TableFormat = "table"
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Thu Jun 15 15:02:17 GMT 2023
    - 1.3K bytes
    - Viewed (0)
Back to top