Re: Form fields - should be OrderedDict?

2020-04-10 Thread James Bennett
On Fri, Apr 10, 2020 at 10:40 PM ‫אורי‬‎ wrote:‬ > In this form I need to insert fields in the beginning of the form, and > therefore I call move_to_end. It worked with Django 2.2 but not with 3.0 > because this method is not defined in a dict. So I think if you revert to > using OrderedDict, u

Re: Form fields - should be OrderedDict?

2020-04-10 Thread אורי
Hi James, In this form I need to insert fields in the beginning of the form, and therefore I call *move_to_end*. It worked with Django 2.2 but not with 3.0 because this method is not defined in a dict. So I think if you revert to using OrderedDict, users will be able to use this method to insert f

Re: Form fields - should be OrderedDict?

2020-04-10 Thread James Bennett
The purpose of OrderedDict is that it's a dictionary type where iteration yields keys in the order they were inserted. In older versions of Python, this was not guaranteed, so a special ordered version was needed. Django 3.0 supports only Python 3.6 and newer; as of Python 3.6, iterating a normal

Form fields - should be OrderedDict?

2020-04-10 Thread אורי
Django developers, When trying to upgrade Django from 2.2 to 3.0, I encountered a problem because form fields were changed from OrderedDict to a dict. I asked on Stack Overflow and got an answer, which was to change the definition of self.fields in my form to OrderedDict ( https://stackoverflow.co

Re: Adding ability to choose AutoField type (signed vs unsigned)

2020-04-10 Thread Caio Ariede
I believe that it is already possible to trigger new migrations in a third-party app by changing its AppConfig.label, for example. Please correct me if I’m wrong. >From that perspective, it think it wouldn’t be wrong if a migration is created >after someone changes its AppConfig’s default_auto_

Hashing Session Keys in backends

2020-04-10 Thread mark
After renewed interest because of potential database timing attacks (T31412 ) I'm looking into an existing PR (PR8736 for T21076 ) for adding the possibility of

Re: On adding comments to database schema

2020-04-10 Thread SoungRyoul Kim
add parameter "db_column_comment" to Field() and. db_table_comment class AModel(models.Model): aaa = model.CharField(help_text="i am help_text", db_column_comment="i am db_comment",~~~) class Meta: db_table = "a_model_example_name" db_table_comment ="this

Re: Widget Media Class

2020-04-10 Thread David Smith
Hi Carlton, Thank you for the response. I really appreciate your continued support / guidance. Sorry, for asking the question in that way, eventually I'll learn 'how things are done round here' :-) I'll go and investigate in more detail. David -- You received this message because you are s

Re: Adding ability to choose AutoField type (signed vs unsigned)

2020-04-10 Thread Adam Johnson
Ah yes third party apps would be tricky. An AppConfig setting would make sense, although I don't believe there's any precedent. It could also be done by making DEFAULT_AUTOFIELD take a dictionary mapping app labels to field names. On Fri, 10 Apr 2020 at 08:29, Nick Pope wrote: > Ah. I hadn't th

Re: Adding ability to choose AutoField type (signed vs unsigned)

2020-04-10 Thread Nick Pope
Ah. I hadn't thought about that - only got as far as being able to define a new default value in DEFAULT_AUTOFIELD in the start project template so that existing projects are not suddenly forced to migrate. An alternative is to have something on the AppConfig. I'm sure for most people the large