Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 348 for encodeArg (0.17 sec)

  1. docs/en/docs/tutorial/encoder.md

    === "Python 3.10+"
    
        ```Python hl_lines="4  21"
        {!> ../../../docs_src/encoder/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="5  22"
        {!> ../../../docs_src/encoder/tutorial001.py!}
        ```
    
    In this example, it would convert the Pydantic model to a `dict`, and the `datetime` to a `str`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  2. docs/em/docs/tutorial/encoder.md

    ⚫️ 📨 🎚, 💖 Pydantic 🏷, & 📨 🎻 🔗 ⏬:
    
    === "🐍 3️⃣.6️⃣ & 🔛"
    
        ```Python hl_lines="5  22"
        {!> ../../../docs_src/encoder/tutorial001.py!}
        ```
    
    === "🐍 3️⃣.1️⃣0️⃣ & 🔛"
    
        ```Python hl_lines="4  21"
        {!> ../../../docs_src/encoder/tutorial001_py310.py!}
        ```
    
    👉 🖼, ⚫️ 🔜 🗜 Pydantic 🏷 `dict`, & `datetime` `str`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Sat Apr 01 09:26:04 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  3. docs/pt/docs/tutorial/encoder.md

    === "Python 3.10+"
    
        ```Python hl_lines="4  21"
        {!> ../../../docs_src/encoder/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="5  22"
        {!> ../../../docs_src/encoder/tutorial001.py!}
        ```
    
    Neste exemplo, ele converteria o modelo Pydantic em um `dict`, e o `datetime` em um `str`.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Thu Apr 18 19:53:19 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  4. docs/zh/docs/tutorial/encoder.md

    对此你可以使用`jsonable_encoder`。
    
    它接收一个对象,比如Pydantic模型,并会返回一个JSON兼容的版本:
    
    === "Python 3.10+"
    
        ```Python hl_lines="4  21"
        {!> ../../../docs_src/encoder/tutorial001_py310.py!}
        ```
    
    === "Python 3.8+"
    
        ```Python hl_lines="5  22"
        {!> ../../../docs_src/encoder/tutorial001.py!}
        ```
    
    在这个例子中,它将Pydantic模型转换为`dict`,并将`datetime`转换为`str`。
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Tue Oct 17 05:59:11 UTC 2023
    - 1.7K bytes
    - Viewed (0)
  5. docs/ko/docs/tutorial/encoder.md

    같은 방식으로 이 데이터베이스는 Pydantic 모델(속성이 있는 객체)을 받지 않고, `dict` 만을 받습니다.
    
    이를 위해 `jsonable_encoder` 를 사용할 수 있습니다.
    
    Pydantic 모델과 같은 객체를 받고 JSON 호환 가능한 버전으로 반환합니다:
    
    ```Python hl_lines="5  22"
    {!../../../docs_src/encoder/tutorial001.py!}
    ```
    
    이 예시는 Pydantic 모델을 `dict`로, `datetime` 형식을 `str`로 변환합니다.
    
    Registered: Mon Jun 17 08:32:26 UTC 2024
    - Last Modified: Wed Dec 08 15:43:31 UTC 2021
    - 1.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/storage/cacher/caching_object_test.go

    		}
    		if a, e := buffer.String(), encoder.expectedResult; e != a {
    			t.Errorf("%s: unexpected result: %s, expected: %s", encoder.identifier, a, e)
    		}
    	}
    	for _, encoder := range encoders {
    		if encoder.callsNumber != 1 {
    			t.Errorf("%s: unexpected number of encode() calls: %d", encoder.identifier, encoder.callsNumber)
    		}
    	}
    }
    
    func TestCachingObjectFieldAccessors(t *testing.T) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 23 15:26:38 UTC 2022
    - 5.1K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/streaming/streaming.go

    }
    
    func (d *decoder) Close() error {
    	return d.reader.Close()
    }
    
    type encoder struct {
    	writer  io.Writer
    	encoder runtime.Encoder
    	buf     *bytes.Buffer
    }
    
    // NewEncoder returns a new streaming encoder.
    func NewEncoder(w io.Writer, e runtime.Encoder) Encoder {
    	return &encoder{
    		writer:  w,
    		encoder: e,
    		buf:     &bytes.Buffer{},
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 25 14:51:36 UTC 2023
    - 3.7K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apimachinery/pkg/runtime/serializer/protobuf/protobuf_test.go

    	creater := &mockCreater{obj: &runtimetesting.MockCacheableObject{}}
    	typer := &mockTyper{gvk: &gvk}
    
    	encoders := []runtime.Encoder{
    		NewSerializer(creater, typer),
    		NewRawSerializer(creater, typer),
    	}
    
    	for _, encoder := range encoders {
    		runtimetesting.CacheableObjectTest(t, encoder)
    	}
    }
    
    type mockCreater struct {
    	apiVersion string
    	kind       string
    	err        error
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 27 03:17:50 UTC 2022
    - 5K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apiserver/pkg/server/storage/storage_codec.go

    	}
    
    	s := serializer.Serializer
    
    	// Give callers the opportunity to wrap encoders and decoders.  For decoders, each returned decoder will
    	// be passed to the recognizer so that multiple decoders are available.
    	var encoder runtime.Encoder = s
    	if opts.EncoderDecoratorFn != nil {
    		encoder = opts.EncoderDecoratorFn(encoder)
    	}
    	decoders := []runtime.Decoder{
    		// selected decoder as the primary
    		s,
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Nov 05 15:03:23 UTC 2022
    - 3.8K bytes
    - Viewed (0)
  10. platforms/core-configuration/graph-serialization/src/main/kotlin/org/gradle/internal/serialize/graph/package-info.java

     *      The WriteContext keeps track (among other things) of the low level binary stream (actually, a Gradle serialization {@link org.gradle.internal.serialize.Encoder Encoder}) and the codec to be used.
     *  </p>
     *  <p>
     *      Object serialization is a graph-walking process, and as such, it has a recursive nature.
     *  </p>
     *  <p></p>
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Sat Jun 08 11:29:30 UTC 2024
    - 4.7K bytes
    - Viewed (0)
Back to top