Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2024-03-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Ülgen Sarıkavak):

 * cc: Ülgen Sarıkavak (added)


Old description:

> 
> This is more of an idea than bug but most of the time when need to use
> authentication without using `contrib.auth` one needs to rewrite some of
> the parts that can be reused if it were in base_user when the interface
> is similar to django.contrib.auth.
> I am mostly talking about update_last_login function and AnonymousUser
> when custom user is derived from AbstractBaseUser.
>
> May be create AnonymousBaseUser with parts that are compatible to
> AbstractBaseUser in `base_user.py` and use that as base class for
> AnonymousUser. Also, update_last_login function can be moved to
> `base_user.py` so that it can be reused.

New description:

 
 This is more of an idea than bug but most of the time when need to use
 authentication without using `contrib.auth` one needs to rewrite some of
 the parts that can be reused if it were in base_user when the interface is
 similar to django.contrib.auth.
 I am mostly talking about update_last_login function and AnonymousUser
 when custom user is derived from AbstractBaseUser.

 May be create AnonymousBaseUser with parts that are compatible to
 AbstractBaseUser in `base_user.py` and use that as base class for
 AnonymousUser. Also, update_last_login function can be moved to
 `base_user.py` so that it can be reused.

--
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018e50511a2b-36cffc80-dcf5-414d-9b0d-31cf5750894d-00%40eu-central-1.amazonses.com.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2022-05-31 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  dev
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Abhijeet Pal):

 Hi, the ticket https://code.djangoproject.com/ticket/20313 was never
 merged. Do you this ticket is still relevant then maybe I can contribute
 to it without worrying about 20313?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701811d2a8e90-cdff237a-edcb-4fa4-ab2e-68eb239b260d-00%40eu-central-1.amazonses.com.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+

Comment (by Sagar Chalise):

 Sorry for that, I was just replying to your queries and didn't mean to
 make any changes to ticket status.
 Replying to [comment:10 Carlton Gibson]:
 > Please stop changing the flags on the ticket.
 >
 > Accepted means "Yes, this is a reasonable ticket" — Unreviewed just
 means someone else has to make the same decisions.
 >
 > I reviewed the patch: it does need improvement tests and docs etc. When
 those points are addressed it's OK to unflag those boxes.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.3bb9a753b79b00a538a026986e5b45f1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Carlton Gibson):

 * needs_docs:  0 => 1
 * needs_better_patch:  0 => 1
 * needs_tests:  0 => 1
 * stage:  Unreviewed => Accepted


Comment:

 Please stop changing the flags on the ticket.

 Accepted means "Yes, this is a reasonable ticket" — Unreviewed just means
 someone else has to make the same decisions.

 I reviewed the patch: it does need improvement tests and docs etc. When
 those points are addressed it's OK to unflag those boxes.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.1098d55d564fae331a7a60a188f0e24d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Sagar Chalise):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Unreviewed
 * needs_tests:  1 => 0
 * needs_docs:  1 => 0


Comment:

 Yes, when I avoid `contrib.auth` I need to rewrite the part I moved to be
 used by my custom authentication middleware. I think it makes sense to
 provide the interface similar to `AbstractBaseUser` for maybe
 `AbstractAnonymousUser` just for code reusabilty. Obviously this can be
 thought of for other stuffs such as backends as well where there is no
 need of `Permission` model.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.c67e46cb939aae6d00d7abf8d76ebdf9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1
 * stage:  Unreviewed => Accepted
 * needs_tests:  0 => 1
 * needs_docs:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.25469cce9fa669004e37e14896524cf2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Carlton Gibson):

 Yes, I see how the patch is meant to work **but** unless/until we have
 #20313 in play custom anonymous users simply aren't supported. (In that
 case there's little motivation for this change.)

 Are you using a custom anonymous user yourself? If so, how are you
 switching it in? With a custom middleware? (If not, why do you want this
 change?)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.1bde51e100baaa1a861fa2d98831fd14%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Sagar Chalise):

 * needs_better_patch:  1 => 0
 * stage:  Accepted => Unreviewed
 * needs_tests:  1 => 0
 * needs_docs:  1 => 0


Comment:

 Well, I hadn't thought of scenarios regarding swappable anonymous user,
 the simple use case I am seeing is similar to `AbstractBaseUser` that is
 recommended as base class of custom user in django documentation. The
 methods and attributes that are available in `AbstractBaseUser` are
 availabe in `AnonymousBaseUser`. This way I see users creating
 `AnonymousUser` class based on `AnonymousBaseUser`  if they need to
 implement  AnonymousUser  on their own especially in authentication
 middleware and when not using `contrib.auth`.

 Maybe something like:


 {{{
 class AnonymousUser(AnonymousBaseUser):
 pass
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.f1e5d49b31284f3a68d6034c4b28bbff%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Accepted
Has patch:  1  |  Needs documentation:  1
  Needs tests:  1  |  Patch needs improvement:  1
Easy pickings:  0  |UI/UX:  0
---+
Changes (by Carlton Gibson):

 * needs_better_patch:  0 => 1
 * stage:  Unreviewed => Accepted
 * needs_tests:  0 => 1
 * needs_docs:  0 => 1


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.5664f28fa6ae85b163b241e4e2e6646c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  New feature|   Status:  new
Component:  contrib.auth   |  Version:  master
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Carlton Gibson):

 * type:  Uncategorized => New feature
 * version:  2.0 => master
 * component:  Uncategorized => contrib.auth


Comment:

 Hi Sagar. This is at least related to #20313. Q: How are you specifying
 your custom `AnonymousUser` class?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.9920c2c866c92cc7bdf720a661eab128%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  Uncategorized  |   Status:  new
Component:  Uncategorized  |  Version:  2.0
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Carlton Gibson):

 * status:  closed => new
 * has_patch:  0 => 1
 * resolution:  needsinfo =>


Comment:

 Thanks Sagar. I'll re-open so we can have a look.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.7aca4d2e40abfd01f55221da2cf354fa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-17 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  2.0
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Sagar Chalise):

 Opened up a PR: https://github.com/django/django/pull/9948

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.1a0750045f589c94a3412e5bbfe728e2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #29381: Move some parts of `django.contrib.auth.models` to `django.contrib.auth.base_user` for reusability

2018-05-09 Thread Django
#29381: Move some parts of `django.contrib.auth.models` to
`django.contrib.auth.base_user` for reusability
---+--
 Reporter:  Sagar Chalise  |Owner:  nobody
 Type:  Uncategorized  |   Status:  closed
Component:  Uncategorized  |  Version:  2.0
 Severity:  Normal |   Resolution:  needsinfo
 Keywords: | Triage Stage:  Unreviewed
Has patch:  0  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Carlton Gibson):

 * cc: Carlton Gibson (added)
 * status:  new => closed
 * resolution:   => needsinfo


Old description:

> This is more of an idea than bug but most of the time when need to use
> authentication without using `contrib.auth` one needs to rewrite some of
> the parts that can be reused if it were in base_user when the interface
> is similar to django.contrib.auth.
> I am mostly talking about update_last_login function and AnonymousUser
> when custom user is derived from AbstractBaseUser.
>
> May be create AnonymousBaseUser with parts that are compatible to
> AbstractBaseUser in `base_user.py` and use that as base class for
> AnonymousUser. Also, update_last_login function can be moved to
> `base_user.py` so that it can be reused.

New description:

 
 This is more of an idea than bug but most of the time when need to use
 authentication without using `contrib.auth` one needs to rewrite some of
 the parts that can be reused if it were in base_user when the interface is
 similar to django.contrib.auth.
 I am mostly talking about update_last_login function and AnonymousUser
 when custom user is derived from AbstractBaseUser.

 May be create AnonymousBaseUser with parts that are compatible to
 AbstractBaseUser in `base_user.py` and use that as base class for
 AnonymousUser. Also, update_last_login function can be moved to
 `base_user.py` so that it can be reused.

--

Comment:

 Hi Sagar. Thanks for the input.

 I'm going to close this as `needsinfo` as is. The general idea is ''Yeah,
 possibly'' but it's too vague to be actionable in its current form.

 If you want to push this forwards then I would recommend an exploratory
 PR: make some (small) changes; what tests break?; what does it allow you
 to do?; etc. From there we've got something concrete to assess. Does that
 make sense?

 Please feel free to re-open this issue if you come up with something
 concrete along these lines!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/070.223b7ce7f581b982b1fb28b747976570%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.