Re: Regarding help for web development career

2021-12-27 Thread 'Adam Johnson' via Django developers (Contributions to Django itself)
Welcome!

There are many different ways to contribute to Django - the forum,
blogging, translating, documenting, writing code, and more. Our
Contributing Guide can help you get started with many of these:
https://docs.djangoproject.com/en/stable/internals/contributing/

If you’re looking to work with the code base (for documentation or code),
check out the “Advice for New Contributors” section:
https://docs.djangoproject.com/en/stable/internals/contributing/new-contributors/
. Then see if you can work through the “Writing Your First Patch” tutorial:
https://docs.djangoproject.com/en/stable/intro/contributing/ .

If you get stuck or have questions, post back here or in the “Mentorship”
section on the forum:
https://forum.djangoproject.com/c/internals/mentorship/10

Hope that helps,

Adam

On Mon, 20 Dec 2021 at 18:15, Nandini Rai  wrote:

> Hi it's Nandini here, pursuing my graduation (first year) at Delhi
> University. I am actively looking for good GSOC organizations to
> contribute. I am interested in web development and worked with Java, HTML,
> python and many more.
>
> I thought of asking that may I contribute with you (as good one for me to
> start). If yes please guide me how to proceed and let me know how I can
> contact you for further help.
>
> Hoping for a positive reply.
>
> --
> 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/345b365c-50e8-4d11-9f76-53443b68410en%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/CAMyDDM0BZho7qCjy-EOzYthu_bg6yRHdjRJ6ukQ34i8%2Bt%2BOD7A%40mail.gmail.com.


Separate between words in Django commands and methods

2021-12-27 Thread אורי
Hi,

Please check this new ticket I created today:
https://code.djangoproject.com/ticket/33387

I think Django commands should separate words by underscores, like function
names and variables names in Python, according to PEP 8.

This is also relevant to *TestCase* methods such as *setUp* and
*tearDownClass*. Although there I assume Django inherits them from Python
the language, and maybe the changes should be done also there.

By the way, I already defined a few such commands in Speedy Net since 2019:
https://github.com/speedy-net/speedy-net/tree/master/speedy/core/base/management/commands

Thanks,
Uri.
אורי
u...@speedy.net

-- 
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/CABD5YeE_FPpcxJaHN2VuztqywgO4DEGjairetf7p24TLqmrf2g%40mail.gmail.com.


Re: Passing an integer-only key to KeyTransform

2021-12-27 Thread Niccolò Mineo
I ended up using the JSONB_EXTRACT_PATH function (I am using Postgres), 
although it's a pity not to be able to use KeyTransform in this situation.

Il giorno lunedì 27 dicembre 2021 alle 10:59:22 UTC+1 Mariusz Felisiak ha 
scritto:

> Hi,
>
> Integers (and strings that can be cast to integers) on the first-level are 
> always interpreted as index transforms in arrays (as documented 
> )
>  
> because you can store a JSON array in the JSONField. Unfortunately, you 
> have to use a custom database function or  RawSQL() to get this data. 
> Please also take into account that KeyTransform() is an undocumented 
> transformation (ticket #26511 
> ). 
>
> Best,
> Mariusz
>
>

-- 
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/141d7fc0-e10f-459c-a24a-61006e4462d9n%40googlegroups.com.


Re: Passing an integer-only key to KeyTransform

2021-12-27 Thread Mariusz Felisiak
Hi,

Integers (and strings that can be cast to integers) on the first-level are 
always interpreted as index transforms in arrays (as documented 
)
 
because you can store a JSON array in the JSONField. Unfortunately, you 
have to use a custom database function or  RawSQL() to get this data. 
Please also take into account that KeyTransform() is an undocumented 
transformation (ticket #26511 ). 


Best,
Mariusz

-- 
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/3cd83f63-c0d9-4559-8bf6-aa6c5ba03b7fn%40googlegroups.com.


Passing an integer-only key to KeyTransform

2021-12-27 Thread Niccolò Mineo
On a Django 3.2 installation, I am trying to pass a 
stringified integer-only zip code as the key_name argument to KeyTransform:

>>> stats_qs = stats.annotate(municipality_stats=KeyTransform("66049", 
"data")).values("municipality_stats")


As highlighted above, it fails to work. The reason, as you can see in bold 
below, is that the key is being interpolated as an integer in the resulting 
query:

>>> str(stats_qs.query)
'SELECT ("datasets_stats"."data" -> *66049*) AS "municipality_stats" FROM 
"datasets_stats" WHERE "datasets_stats"."stats_type" = 
totals_municipalities LIMIT 1'

This seems like a bug to me, as a JSON object is not allowed to have an int 
key, though - only str.

Has anyone successfully managed to make this work?

-- 
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/102f7e4d-d189-4352-acd5-4590042365ban%40googlegroups.com.


Re: Yaml serializer output

2021-12-27 Thread Sergey Fursov
Please, disregard the part about failing tests, I had an old version 
locally without this commit applied 
https://github.com/django/django/commit/a57c783dd4e6dc73847081221827a1902eede88b
Anyway, I think it might be confusing (at least it is confusing to me) that 
by default yaml serializer produces a different output than provided in docs

воскресенье, 26 декабря 2021 г. в 22:21:42 UTC+3, Sergey Fursov: 

> Hi there,
>
> Before opening a ticket I would like to discuss my problem here.
>
> Django docs say:
>
> ```
> YAML¶  
>
> YAML serialization looks quite similar to JSON. The object list is 
> serialized as a sequence mappings with the keys “pk”, “model” and “fields”. 
> Each field is again a mapping with the key being name of the field and the 
> value the value:
> - fields: {expire_date: !!timestamp '2013-01-16 08:16:59.844560+00:00'} 
> model: sessions.session pk: 4b678b301dfd8a4e0dad910de3ae245b 
> ```
> https://docs.djangoproject.com/en/4.0/topics/serialization/#yaml
>
> But I cannot find a way to produce the same output. Both available to me 
> environments (MacOS and Debian linux inside a Docker container) product a 
> simpler output, like
>
> ```
> >> obj = core.ModelA.objects.get(id=1)
> >> print(serializers.serialize('yaml', [obj]))
> - model: core.modela
>   pk: 1
>   fields:
> created: 2017-02-05 16:11:44.310613+00:00
>  other fields ...
> ```
>
> I've found this after running full Django test suite when 6 test from 
> django/tests/timezones/tests.py failed. Example failure:
>
> ```
> FAIL: test_naive_datetime_with_microsecond 
> (timezones.tests.SerializationTests)
> --
> Traceback (most recent call last):
>   File "/Users/geyser/coding/opensource/django/tests/timezones/tests.py", 
> line 671, in test_naive_datetime_with_microsecond
> self.assert_yaml_contains_datetime(data, "2011-09-01 13:20:30.405060")
>   File "/Users/geyser/coding/opensource/django/tests/timezones/tests.py", 
> line 625, in assert_yaml_contains_datetime
> self.assertRegex(yaml, r"\n  fields: {dt: !(!timestamp)? '%s'}" % 
> re.escape(dt))
> AssertionError: Regex didn't match: "\\n  fields: {dt: !(!timestamp)? 
> '2011\\-09\\-01\\ 13:20:30\\.405060'}" not found in '- model: 
> timezones.event\n  pk: null\n  fields:\ndt: 2011-09-01 
> 13:20:30.405060\n'
> ```
>
> I've tried to install several different pyyaml versions (from 6.0 down to 
> 5.1.2).
>
> Do I miss something or it is a valid issue for opening a ticket?
>
> Thanks,
> Sergey Fursov
>

-- 
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/6793d234-92f5-46fa-bc19-3996626dc456n%40googlegroups.com.