I can't remember the right term, but you don't want (just) "payment processing", you want like
paid-user lifecycle management or something
sunil_bansal has quit
thiras has quit
theology
oh
maks25 joined the channel
doismellburning
sounds like you want something handling allll of that, on top of "here's a payment prompt for something"
entrop joined the channel
Crystalk3 joined the channel
brainpro1 joined the channel
thiras joined the channel
Crystalk3
Hey, I'm trying to understand permissions. They are just models like User and Groups, right? It's just a name and then everywhere you want to restrict something you have to do something like 'does this user have this permission, if so do this, if not do this'
Donitzo joined the channel
Except with models, as I understand it you set something in the model itself and then it restricts "automatically" , but outside of that, there's nothing magical happening, right?
It's just a name
And then you use it like a boolean
brainproxy has quit
And users and Groups have FK to that permission
jalalsfs joined the channel
FunkyBob
Crystalk3: yes, it's just a name... and ayou can add as many as you like
Groups are to help with bulk assignment and management of permissions
Crystalk3
FunkyBob: As many what?
Permissions to a user/group?
jalalsfs has quit
FunkyBob
you can define as many permissions as you like
Crystalk3
OK
FunkyBob
and, yes, assign as many as you wish to each user/group
Crystalk3
Next question
What on earth is 'content_type' ? It says 'Required' in https://docs.djangoproject.com/en/1.11/ref/cont... but I don't understand what any of 'A reference to the django_content_type database table, which contains a record for each installed model.' means
FunkyBob
ok, so for each model in your project, an entry is made in the ContentTypes table
this is how teh system knows which model a permission is related to
[a slightly broken concept, in truth, but it's how the system has lived for ~15 years now]
permission required deecorator just wants the label for the permissions
Crystalk3
Yeah the codename or name but I have to create it first right?
FunkyBob
no, Django can create it for you, as I said
djapo joined the channel
Crystalk3
I'm sorry, but I'm not understanding
OtherAllan joined the channel
FunkyBob
on every model you define
you can specify a list of permissions you want for that model
Crystalk3
The link you sent me is about the permissions Meta option on a model, right?
FunkyBob
and django will create thos epermissions for you
ironfroggy joined the channel
Crystalk3
Well, I didn't know that, I thought you had to create the permissions manually and then reference them in a Meta option in the model
It's good to know
Thank you
However
JuanDaugherty joined the channel
As I said, I'm talking about a permission I need for the permission_required decorator. It's not related to any model so how would I specify a list of permissions for that model, so that django creates it for me, as you said?
FunkyBob
it's a limitation of the default djangopermissions model that all permissions must be related to a model
01:33 <+FunkyBob> [a slightly broken concept, in truth, but it's how the system has lived for ~15 years now]
hypertiger has quit
moldy
if you need more flexibility, use @user_passes_test or something
Crystalk3
With djangopermissions you mean django.contrib.auth.models.Permission, correct?
FunkyBob
it's a shame... if they just let content_type be null on Permission....
Crystalk3: correct
Crystalk3
But then how do I use the permission_required decorator
?
FunkyBob
...
Crystalk3
I sound like a broken record, I'm sorry
FunkyBob
the same as always?
moldy
by not using it ;)
miz- has quit
FunkyBob
Crystalk3: which step of the docs on using it is confusing you?