Re: Django's issue tracker uses timezone CDT

2021-08-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
I'd be +1 on moving the default to UTC.

Or we could change Trac to pick up the browser's timezone offset and
display datetimes accordingly.

On Fri, 6 Aug 2021 at 15:28, Tom Carrick  wrote:

> While moving the default to UTC is probably a good idea - you can change
> this for yourself in Preferences -> Localization.
>
> Tom
>
> On Fri, 6 Aug 2021 at 16:22, Jacob Rief  wrote:
>
>> This presumably is a legacy from the days when Adrian Holovaty and
>> Jacob Kaplan-Moss started the Django project in Kansas City.
>>
>> The Django issue tracker uses the timezone CDT which is correct for
>> central Americas,
>> but since Django became a world wide project, in my opinion this should
>> either
>> be UTC, or if possible, the browser's local time.
>>
>> Is there any reason, why this never has been adjusted?
>>
>> – Jacob
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django developers (Contributions to Django itself)" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to django-developers+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/django-developers/9d952402-1efd-419e-b4a5-0f8635c1ac73n%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/CAHoz%3DMaOq8Hj_8hnjdM%3D9to6mRSQLppZ5oHWJjQ9CA8H%3Dsqq6Q%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM0nkBbiZfSQNq_rNnnKCkOmFzUcrXZF%3DSk3JrQKz6m_AQ%40mail.gmail.com.


Re: Is there any reason to set the default reverse relationship name in the current format?

2021-08-09 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Ruby on Rails uses "correct" plural forms in code. But in order to do this
it contains a special library to pluralize words correctly, e.g. octopus ->
octopuses. And naturally that strategy requires per-language and per-word
knowledge, and can go wrong when trying to use non-english words.

Rather than use such "magic", Django takes a simple, pragmatic, predictable
approach of just appending "_set". Similarly Meta.verbose_name_plural
simply appends an "s". If these behaviours aren't suitable for you, you're
free to override them for your project.

You can use "s" instead of "_set" for all your foreign keys with the
interpolation feature of ForeignKey (
https://docs.djangoproject.com/en/3.2/ref/models/fields/#django.db.models.ForeignKey.related_name
) plus a partial (
https://adamj.eu/tech/2021/05/05/3-uses-for-functools-partial-in-django/ ) :

from functools import partial
from django.db import models

ForeignKey = partial(models.ForeignKey, related_name="%(class)ss")


class Author(models.Model):
...


class Book(models.Model):
author = ForeignKey(Author, on_delete=models.CASCADE)
...

On Thu, 5 Aug 2021 at 17:38, 김정훈  wrote:

>
> Hi,
>
> Django's default reverse relationship name is a model name followed by a
> _set suffix. In terms of readability, depending on the type of
> relationship used, I think it would be good to make the default reverse
> relationship name in the singular or plural form of the model name.
>
> Is there any reason to set the default reverse relationship name in the
> current format?
>
> Regards,
> Jeonghun Kim
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/2407b63e-0f51-4cf8-8308-c3a72716ace2n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAMyDDM02q4hCjCgzdiS%2BgLGdMWZBSBmqDuFvOD3jfuK6BLiUsw%40mail.gmail.com.


Help: Getting error when trying run test “RuntimeError” Database access not allowed

2021-08-09 Thread Muhammad Shehzad
Image attached
[image: ccc.png]

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/26eb28c6-9197-458c-87b2-9484ee03c28an%40googlegroups.com.


Re: Help: hi maybe this will help you https://stackoverflow.com/questions/54661112/pytest-and-failed-database-access-not-allowed-use-the-django-db-mark-or-the

2021-08-09 Thread Umar Farooq
It's showing Database access error your test seems to be alright can you
send me the db connection

On Mon, 9 Aug 2021, 4:48 PM Muhammad Shehzad,  wrote:

> Image attached
> [image: ccc.png]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/26eb28c6-9197-458c-87b2-9484ee03c28an%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAPpmBN_o-EPR6oxCjkZzCZehyYrZUc%2BPbvk%3DtDHT-fbVxvhftg%40mail.gmail.com.