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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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.

Reply via email to