Why do you need an additional model for automatic payments?

I don't know the whole project, but I would just add a field to the
Payment class



On 5/1/17, Victor Porton <[email protected]> wrote:
> I store into the DB payments received through PayPal. Every payment is
> either manual or automatic (automatic payments are done for the user by
> PayPal automatically, based on user's permission to pay in the future). I
> wish to distinguish manual and automatic payments in the DB. But in the
> following code both regular payments and automatic payments share the same
> table, so that they cannot be distinguished. I ask for an advice how to
> make them distinct in the DB. The best thing I invented insofar is to add
> `dummy = models.SmallIntegerField()` to AutomaticPayment class, to allocate
>
> a new table for it. Are there better ways?
>
> class Payment(models.Model):
>     transaction = models.OneToOneField('BaseTransaction')
>     email = models.EmailField(null=True)
>
> class AutomaticPayment(Payment):
>     pass
>
> By the way, it is an open source project, so you will benefit from my work.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/2e6e83b6-616a-4fc8-9abc-32d2ce25e247%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALn3ei0ERr8kmX1keQ2sAo44qj8toZrPNDakNkxLAxSATAEWuQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to