In the first half, we give an introduction to modern serialization systems, Protocol Buffers, Apache Thrift and Apache Avro. Which one does meet your needs?
In the second half, we show an example of data ingestion system architecture using Apache Avro.
In the first half, we give an introduction to modern serialization systems, Protocol Buffers, Apache Thrift and Apache Avro. Which one does meet your needs?
In the second half, we show an example of data ingestion system architecture using Apache Avro.
24. ORMのリレーションで出来ること
3.エクストラフィールドで多対多のリレーション
ManyToManyField の through 引数
Person Group
多:多
Membership
中間モデルに項目を持たせて、自分で定義したい場合
4.一対一のリレーション
OneToOneField
Place
1:1
Restaurant
モデルを継承して項目追加する代わりに
OneToOneField で項目追加したモデルを作る
!
継承ができないかというと、そうではない
25. モデルの継承
1.抽象ベースクラス
CommonInfo
継承
Student
親は実体を持たない
class CommonInfo(models.Model):
class Meta:
abstract = True
2.マルチテーブル継承
Place
継承
Restaurant
親も子も実体を持つ
class Place(models.Model):
class Student(CommonInfo): class Restaurant(Place):
3.プロキシモデル
User
継承
MyUser
from django.contrib.auth.models import User
子は実体を持たない
子は項目追加できない
親のメソッドを拡張したい時
class MyUser(User):
class Meta:
proxy = True
!
def do_something(self):
...
70. feedbackで返された
トークンは、削除する
for (token_hex, fail_time) in apns.feedback_server.items():
#未使用のデバイストークンを削除
for token in DeviceToken.objects.filter(token=token_hex):
token.delete()
!