Re: Add user to Group after purchase

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer? We can help you in this and related tasks at fair prices. Reply or send email to divy...@pythonmate.com Best Regards, Divyesh Khamele, Pythonmate On Tue, 29 Sep 2020, 9:54 am Lightning Bit, < thelegendofearthretu...@gmail.com> wrote: > Hi A

Re: Add user to Group after purchase

2020-10-02 Thread Lightning Bit
I did a bit of testing and I discovered a new method for adding a user to a group after purchase. It is similar to signals, except it strictly uses the views.py: This current version is bugged (since I am a Django noob), but if I can somehow direct the active authenticated user to the new group

Re: Add user to Group after purchase

2020-10-01 Thread Derek
I am not sure about your details but is my code structure. Note that the signals are in the same file as the models (may be easier to start there first). from django.db.models.signals import post_save class MyModel(Model): id = AutoField(primary_key=True) # etc. def MyModel_postsave

Re: Add user to Group after purchase

2020-09-30 Thread King Niko
Thanks Derek! I tried using the signals but it is not working. This is how my signals and models looks: Signals.py: from django.contrib.auth.models import User from .models import * from django.db.models.signals import post_save from django.dispatch import receiver from django.contrib.auth.models

Re: Add user to Group after purchase

2020-09-29 Thread Derek
You need to use a "post save" signal; see: https://docs.djangoproject.com/en/3.1/ref/signals/#post-save On Tuesday, 29 September 2020 at 06:23:19 UTC+2 Lightning Bit wrote: > Hi All, > > How would one add a user to a certain Backend group in the Django > Administration after a user purchases a

Add user to Group after purchase

2020-09-28 Thread Lightning Bit
Hi All, How would one add a user to a certain Backend group in the Django Administration after a user purchases a particular item? I have played around with tons of techniques but nothing is working. Thanks! -- You received this message because you are subscribed to the Google Groups "Djan