예제 #1
0
class UserOfflineScriptExportAccessSerializer(serializers.ModelSerializer):
    date = DateTimeField(required=False, read_only=True)
    payed = DateTimeField(required=False, read_only=True)

    class Meta:
        model = UserOfflineScriptExportAccess
        fields = ('id', 'user', 'payed', 'date')
예제 #2
0
class UserPaymentSerializer(serializers.ModelSerializer):
    date = DateTimeField(required=False, read_only=True)
    payed = DateTimeField(required=False, read_only=True)

    def create(self, validated_data):
        validated_data['user'] = CustomUser.objects.get(pk=validated_data.get('user'))
        return UserPayment.objects.create(**validated_data)

    def update(self, instance, validated_data):
        return instance

    class Meta:
        model = UserPayment
        fields = ('id', 'name', 'user', 'sum', 'date', 'payed', 'total_sum')
예제 #3
0
class TableSerializer(serializers.Serializer):
    id = serializers.CharField(required=True)
    name = serializers.CharField(required=True)
    text_coll_name = serializers.CharField(required=True)
    text_coll_size = serializers.IntegerField(required=True)
    text_coll_position = serializers.IntegerField(required=True)
    date = DateTimeField(required=False, read_only=True)
    date_mod = serializers.DateTimeField(required=True)
    colls = CollsField()

    class Meta:
        fields = ('id', 'name', 'text_coll_name', 'text_coll_size',
                  'text_coll_position', 'date', 'date_mod', 'colls')
예제 #4
0
class PaymentLogSerializer(serializers.ModelSerializer):
    date = DateTimeField(required=False, read_only=True)

    class Meta:
        model = PaymentLog
        fields = ('id', 'name', 'user', 'sum', 'debit_credit', 'date')
예제 #5
0
class LocalPaymentSerializer(serializers.ModelSerializer):
    date = DateTimeField(required=False, read_only=True)

    class Meta:
        model = LocalPayment
        fields = ('id', 'name', 'user', 'sum', 'date')