This page is still under construction.

back to posts

Codecast #5: Complicated billing system with Stripe, plus multiple user types using proxy models by Daniel Feldroy

[01:22:00] 07/09/2020 models.py

from model_utils.models import TimeStampedModel

class Invoice(TimeStampedModel):
 pass

Regular model, bu provides automatice create at and modified at timestamps.

[02:15:17] 07/12/2020 You can access Custom User Field via request. For instance, to check if user has Stripe ID do this in views.py:

class Something(LoginRequiredMixin, View):
	def post(self, request, *args, **kwargs):
		if request.user.stripe_user_id:
			do something
		

If you found it useful, please consider signing up to my newsletter. Every week, I share my thoughts on cool stuff I found around the internet. No spam, ever. Unsubscribe any time.