Re: CSRF middleware conflicts with request.upload_handlers

2015-11-16 Thread Collin Anderson
Maybe @csrf_check_header_only? I usually put the token in POST for my ajax calls. On Monday, November 16, 2015 at 12:51:18 AM UTC-5, Curtis Maloney wrote: > > > So I recently ran into the csrf/upload_handlers conflict as mentioned in > the not > https://docs.djangoproject.com/en/1.8/topics/http

Re: "Project" vs "App"

2015-11-19 Thread Collin Anderson
What's a sitecustomize.py? :) I think apps _can_/_may_ be reusable. I have plenty of non-reusable apps. Why should they be reusable? I think apps _should_ not depend on a project. On Thu, Nov 19, 2015 at 4:54 AM, guettli wrote: > I created a ticket to find a better definition of "Project" vs "A

Re: Bringing some popular must have django tools/packages under django org umbrella

2015-11-24 Thread Collin Anderson
Hi, Say a little bit more: What would be the goal? What would you hope would be accomplished by doing this? Thanks, Collin On Tuesday, November 24, 2015 at 1:27:11 PM UTC-5, Asif Saifuddin wrote: > > How is the idea? tools like django-debug-toolbar, django-silk, > django-taggit, django-filter

Re: is_authenticated as property

2015-12-02 Thread Collin Anderson
On a somewhat unrelated note, is_authenticated really only makes sense when using request.user.is_authenticated. If you simply query a user from the database, is_authenticated will be True, which doesn't make any sense outside the context of a request. is_anonymous makes sense, is_authenticated doe

Re: Referrer Policy Delivery, Django shouldn't do strict referrer check anymore?

2015-12-02 Thread Collin Anderson
Seems to me we could ignore the referrer if we get a valid same-domain Origin header. On Wed, Dec 2, 2015 at 1:29 PM, Flávio Junior wrote: > Some browsers already implement the Referrer Policy draft > , > which gives the

Re: Referrer Policy Delivery, Django shouldn't do strict referrer check anymore?

2015-12-04 Thread Collin Anderson
Also, if we checked the origin header, would it allow us to at least support the "Origin When Cross-Origin" policy in all browsers? (Use the Origin header for Safari and the referrer for all of the other browsers?) On Fri, Dec 4, 2015 at 10:38 AM, Tim Graham wrote: > Flávio, thanks -- since you

Re: Referrer Policy Delivery, Django shouldn't do strict referrer check anymore?

2015-12-05 Thread Collin Anderson
Basically, the origin check would only be useful for safari (in this case). Everywhere else we'd still need to rely on the referrer header. On Sat, Dec 5, 2015 at 3:42 AM, Florian Apolloner wrote: > > > On Friday, December 4, 2015 at 8:03:45 PM UTC+1, Flávio Junior wrote: >> >> I can create a ti

Re: Help needed with the MySQL max index length problem for Django 1.10

2015-12-28 Thread Collin Anderson
Hi All, I finally looked at this more today. I started working on the INDEX (col1(191)) solution from #18392, but unfortunately I don't think we can use that solution in this case because it's a UNIQUE index. (I still think it's best solution for non-unique indexes.) I think these are our options

Re: Help needed with the MySQL max index length problem for Django 1.10

2015-12-29 Thread Collin Anderson
MySQL users can specify the appropriate max_length — which we > should document — there. > > I'd jut give username max_length=120. (Sorry, Picasso.) > > -- > Aymeric. > > > 2015-12-28 23:49 GMT+01:00 Tim Graham >: > >> Ugh, I guess I'm in favor of

Re: Help needed with the MySQL max index length problem for Django 1.10

2015-12-29 Thread Collin Anderson
Though wouldn't mind 180 either. On Tue, Dec 29, 2015 at 2:55 PM, Collin Anderson wrote: > I propose 150 to err on the longer side: > https://github.com/django/django/pull/5891 > > On Tuesday, December 29, 2015 at 5:28:01 AM UTC-5, Aymeric Augustin wrote: >> >> At t

Re: Help needed with the MySQL max index length problem for Django 1.10

2015-12-30 Thread Collin Anderson
I think mysql used to just give a warning and maybe now it's an error? It can currently be reproduced with just a blank project (using django master, mysql 5.5.46-0ubuntu0.14.04.2): mysql -e'create database mb4test charset utf8mb4' django-admin startproject mb4test cd mb4test vi mb4test/settings.p

Re: Backwards-compatibility import shims

2015-12-31 Thread Collin Anderson
Hi All, tldr: I think we should keep django.core.urlresolvers forever, or at least much much longer. Moving things to django.core.urls makes sense; removing the one line import shim from django.core.urlresolvers doesn't make sense to me. General thoughts about compatibility, using this situati

Re: delegating our static file serving

2015-12-31 Thread Collin Anderson
I'm still +1 to django providing a good file solution, whether it be whitenoise, dj-static, or whatever. Here's all I came up with the last time I looked into this. It basically involves passing insecure=True into our current code and sending cache headers. (I feel like the insecure flag could

newforms.fields.UploadedFile Undocumented Backwards Incompatible change

2008-07-11 Thread Collin Anderson
g for the UploadedFile.data attribute, which was only in there for 45 revisions. It would be nice to also have a deprecation warning for UploadedFile.content. Thanks, Collin Anderson http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Uploadedfilechanges http://code.djangoprojec

Re: Security Advisory: BREACH and Django

2013-08-08 Thread Collin Anderson
> > I am doing something a little different with my CSRF tokens, and I believe it guards against BREACH. Instead of sending the token in the HTTP response, I am using javascript to read (and generate if needed) the CSRF token cookie. The javascript reads the token from the cookie and adds it a

Proposal: ./manage check to look for models.BooleanField() without default= value.

2013-08-08 Thread Collin Anderson
The new ./manage check command is for helping people upgrade to a new version of django. https://docs.djangoproject.com/en/dev/ref/django-admin/#check django1.6 changes models.BooleanField() to not default to False any more. This has already bitten me a few times. https://docs.djangoproject.com/

Re: Deprecate admindocs?

2013-08-08 Thread Collin Anderson
Looking at the code, we're only using docutils for parsing reST markup in docstrings. What if we made reST parsing (and docutils) optional? Seems to me admindocs would still be plenty helpful without it. > -- You received this message because you are subscribed to the Google Groups "Django de

Re: [RFC] Python 3 and MySQL

2014-06-06 Thread Collin Anderson
While we're on the topic, I'd like to propose (also?) supporting the pure-python, MySQLdb-compatible pymysql, which INADA Naoki (methane) has also put a lot of work into. pymysql is pure-python, so it's really easy to get up-and running on Mac OS X and in other environments, because you don't

use semantic versioning after 2.0?

2014-07-14 Thread Collin Anderson
Hi All, I just saw #23015 come through (1.9 -> 2.0 not an earth-shattering release). I think it's a little ridiculous that decimal point doesn't really mean anything. I'm wondering if it would make sense, after 2.0, to follow Chrome, Firefox, and semantic versioning (http://semver.org/), and s

Re: use semantic versioning after 2.0?

2014-07-14 Thread Collin Anderson
> MAJOR version when you make incompatible API changes,MINOR version when you add functionality in a backwards-compatible manner Although our changes are backwards compatible, they are only guaranteed to be backwards compatible for the previous two versions. Instead, semver says that code writt

Re: Fields terminology for official Options API

2014-07-31 Thread Collin Anderson
This is awesome. I've always wished that django.contrib.admin used only documented django APIs. It's unfair to 3rd party apps. :) I'm also thankful I won't need to import bitflags just to use this API. > The Options API is at the core of Django, it enables introspection of > Django Models wit

Re: Proposal new Django Admin css style

2014-08-01 Thread Collin Anderson
I like that it's all done without changing the html. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post

Re: Pull django-registration into contrib?

2014-08-01 Thread Collin Anderson
It seems to me, in any case, the first step is to get django-registration actively maintained again. James Bennett is welcoming proposals of people to take over maintenance of the project. Get it working well with custom user models and with python 3. Once django-registration is a thriving app

Re: Updating the organization of the Django Project

2014-08-01 Thread Collin Anderson
> > Also there are like 120 Pull Requests which are over an year old > sometimes.Which scary's off a lot of people. We should do something against > it to have a "cleaner" queue. > In theory every pull request has a trac ticket and the queue is all handled by queries such as: https://code.djang

Re: Proposal new Django Admin css style

2014-08-02 Thread Collin Anderson
I think slowly making small changes over time towards an end goal is better than a quantum leap. I like that in 1.7 we changed admin messages to be green-ish and we started using css rounded corners. Slowly moving towards more mobile/touch friendly and a flat design (replacing gradients) sounds

Re: [GSOC] Weekly update

2014-08-04 Thread Collin Anderson
if we do really need a list, could we gain some performance by caching tuples and converting them to lists instead of caching lists? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails f

Re: Proposal: Use timestamp or hash to determine name when uploading duplicate filenames

2014-08-04 Thread Collin Anderson
It seems to me a setting is not the way to go, but a custom storage would be better. I've made a custom storage the computes the md5 of the content and uses that as the directory of the file, though that generate a whole lot of directories. In a lot of ways, I think it would be great if django

Re: Proposal: Password Validity Layer

2014-08-05 Thread Collin Anderson
Could we handle it with model validation on a custom user model? Maybe add a validate_password() method on the user model? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, se

Re: [GSOC] Weekly update

2014-08-06 Thread Collin Anderson
> > Communication. > > From a purist theoretical perspective, there shouldn't be any argument - > the data we're talking about is a list. Lists have homogeneous elements; > Tuples have heterogeneous elements, but have *positional* homogeneity. A > "Point" is a tuple, because element 0 of the t

Re: ORM Optimization for filtering by related existence

2014-08-07 Thread Collin Anderson
I personally use qs = qs.filter(somefield__gte=1) (works if the id field is an integer) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+u

Re: Requiring GitHub login for actions on Trac

2014-08-14 Thread Collin Anderson
I was looking at the wiki page myself a few weeks ago an noticed it was horribly out of date. I might be nice to keep that page minimal (maybe just a few links to other pages) because normal users aren't allowed to edit it. -- You received this message because you are subscribed to the Google G

Re: [GSOC] Weekly update

2014-08-14 Thread Collin Anderson
Summarizing the conversation I just had with Daniel in IRC: What if we thought about just documenting the high-level api, like what ModelForms uses, and not necessarily document what the django low levels: ORM, migrations, etc would need to use. Could we get away with not documenting _meta.get_fie

Re: [GSOC] Weekly update

2014-08-14 Thread Collin Anderson
Also, I still believe that just because "class Meta:" stole the word "meta", doesn't mean we should take what it should really be called ("options") and put it on this. Can we call the two "meta options api" and "meta fields api"? or "meta schema api". -- You received this message because you

getting django 1.7 out the door

2014-08-14 Thread Collin Anderson
Hi All, If anyone's looking for ways to help get 1.7 out the door, there's a strange but reproducible many-to-many ORM bug happening in migrations. We could use some help narrowing down the cause of it. https://code.djangoproject.com/ticket/23288 Thanks, Collin -- You received this message b

Re: getting django 1.7 out the door

2014-08-14 Thread Collin Anderson
sn't like > this, and there's a reason model validation complains about it. > > Andrew > > > On Thu, Aug 14, 2014 at 6:57 PM, Collin Anderson > wrote: >> >> Hi All, >> >> If anyone's looking for ways to help get 1.7 out the door, th

Wiki Home Page

2014-08-16 Thread Collin Anderson
Hi Russ, I like the new wiki home page. Would it make sense to have a link to Github? People who click "Code" in the top right might be looking for the source code. Thanks, Collin -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsub

Re: GSoC Meta refactor: Bikeshedding time!!

2014-08-18 Thread Collin Anderson
The goal is to have "API methods that let you introspect the fields and relations that exist on a model", right? Why go though the trouble of finding the one specific type for each field (that we'll never be able to change later)? Why have a get_fields() method with an ever-growing number of kw

Re: GSoC Meta refactor: Bikeshedding time!!

2014-08-18 Thread Collin Anderson
Also, I think we should avoid discriminating between "virtual" and non-virtual (as with local vs parent). Why should it matter how a field is stored in the database? I think the distinction will make it harder to use non-relational databases. It maybe helpful to recognize if a field has a "pare

Re: Proposal: Password Validity Layer

2014-08-18 Thread Collin Anderson
Wow. That's simple. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to dja

Re: 1.7 release?

2014-08-19 Thread Collin Anderson
I'm not a core developer, but here's the current situation as far as I can tell. There's been a steady stream of about releases blocker coming in almost once per day, most of them migrations related: https://code.djangoproject.com/query?version=!master&resolution=fixed&severity=Release+blocker&o

Re: GSoC Meta refactor: Bikeshedding time!!

2014-08-22 Thread Collin Anderson
I like the direction the API is heading. RE: composite fields: Would it help to have an attribute on the individual fields like: field.parent = TheCompositeField()? This might help determine which fields to pass into __init__(), and might help when serializing. RE: related objects: I'm interest

Re: Improvement to objects.get_or_create and objects.update_or_create

2014-08-28 Thread Collin Anderson
This is a bit magical. It means adding or removing a unique constraint could have additional unintended side effects. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: integrating django-secure

2014-08-30 Thread Collin Anderson
I still don't see the benefit to a dictionary. It's helpful for DATABASES and CACHES because there can be multiple of them. > It ensures that related settings remain grouped together. It seems to me a common SECURITY_ prefix should be good enough - It satisfies our craving for DRY A _tiny_ more

Re: Please don't kill the ecosystem

2014-09-01 Thread Collin Anderson
I agree that there have been a lot of backwards-incompatible changes over the last few years clean up the API. We've really been in "get stuff done" mode. I do however think it's a not good idea to break all compatibility in one single shot. Python 3 did this and 6 years later it's still preven

Re: Please don't kill the ecosystem

2014-09-03 Thread Collin Anderson
Considering we're trying to come out with more frequent releases, I wonder if it would sometimes make sense to sometimes have a 3-release deprecation for some features. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from thi

Re: proposing max line length of 119 + enforcing it with flake8

2014-09-04 Thread Collin Anderson
we say 119 because it's 120 minus one, just like PEP8 recommends 79 because it's 80 minus one. It allows for one character at the beginning of the line for a plus or minus sign in a diff. -- You received this message because you are subscribed to the Google Groups "Django developers" group. T

Setting dictionaries (was Re: integrating django-secure)

2014-09-04 Thread Collin Anderson
I'm trying to think outside the box on settings. If we want to logically group settings together, what if we supported syntax like this? MIDDLEWARE_CLASSES = ( 'django.middleware.clickjacking.XFrameOptionsMiddleware', SecurityMiddleware(content_type_nosniff=True, xss_filter=True), ) It

Re: Setting dictionaries (was Re: integrating django-secure)

2014-09-04 Thread Collin Anderson
yeah... I thought of circular imports... you would need to lazy-load most imports. not fun. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-develope

Re: Proposal: enhance 1.7 migration docs re django.core.handlers.wsgi:WSGIHandler()

2014-09-05 Thread Collin Anderson
I ran into this problem myself upgrading to to django 1.7. The secret is that get_wsgi_application calls django.setup() which is now required to initialize django. I went through and switched all my code to use get_wsgi_application(). get_wsgi_application() has been in the default wsgi.py in ne

Re: Django views/templates vs. Javascript MVC Front-ends

2014-09-05 Thread Collin Anderson
I think many people are going the django-as-a-REST-server route. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.

Re: [RFC] Python 3 and MySQL

2014-09-07 Thread Collin Anderson
I'm warming up to mysqlclient. I assume it has better performance or is more correct than pymysql? Is there any hope to getting the package included in debian/ubuntu? -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from thi

Re: [RFC] Python 3 and MySQL

2014-09-08 Thread Collin Anderson
Ohh wow. I also just noticed CyMySQL, which is a fork of PyMySQL with optional C speedups. It seems like a good idea in theory, though it appears to have diverged from PyMySQL a bit. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsu

Re: [RFC] Python 3 and MySQL

2014-09-08 Thread Collin Anderson
It's great to see us moving forward on this. Thanks to Naoki for all of the work on this! -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers

Re: [RFC] Python 3 and MySQL

2014-09-08 Thread Collin Anderson
I also don't need python 3.2 support (or even python 3.3 support for that matter) -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubsc

Re: Unifying locale time formats

2014-09-11 Thread Collin Anderson
If you did "git add .", you should be fine without the -a flag, just use git commit -m “Removed seconds from all locales.” -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, se

Re: HTTP/2 and WSGI

2014-09-22 Thread Collin Anderson
On Saturday, September 20, 2014 12:25:02 PM UTC-4, Ryan Hiebert wrote: > > Being the idealist I am, I hope we can find a way to rid ourselves of the > pain of cgi. I'd be more than willing to help, but my help would probably > be more of a hindrance because of the limited exposure I've had with

Re: Storage engine aliases?

2014-10-01 Thread Collin Anderson
> > In hindsight I regret not having pushed harder for integration of > staticfiles into core instead, lots of confusion could have been prevented, > IMO. > Is it too late to move to core? -- You received this message because you are subscribed to the Google Groups "Django developers (Cont

Re: Django Admin - Front-End Improvements

2014-10-04 Thread Collin Anderson
I'm not a designer, but I agree the admin could use some tweaks to keep up with the times. (flat design, more mobile friendly, etc). Here are my personal thoughts, in general: - I like small, gradual changes, changing one thing at a time. Like Tim said, separate tickets. - If possible, try to av

Re: Websockets... again

2014-10-29 Thread Collin Anderson
Hi Luis, There is some work on making a WSGI2 that would include support for http/2 and likely websockets too. That would likely need to happen first or at the same time. https://github.com/python-web-sig/wsgi-ng You could also check out a project called "hendrix" which supports using websocke

Re: More standard template filters

2020-01-29 Thread Collin Anderson
>> similar and you can pop a Jinja2 backend in your TEMPLATES. >> >> >> >> On Fri, 5 Apr 2019 at 07:43, Curtis Maloney wrote: >> >>> On 4/5/19 3:06 AM, Collin Anderson wrote: >>> > Hi All, >>> > >>> > I use django tem

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

2020-04-09 Thread Collin Anderson
Having a DEFAULT_AUTOFIELD setting makes sense to me. On Monday, April 6, 2020 at 12:48:10 PM UTC-4, Adam Johnson wrote: > > Jure - yes switching the setting should generate migrations for all > affected models. The migration guide would cover changing models' primary > key fields to PositiveBig

Removing url() ?

2020-05-05 Thread Collin Anderson
Hi All, Are we _sure_ we want to completely get rid of url()? Yesterday, url() was given a RemovedInDjango40Warning [PR]. The removal was approved as part of the new path() syntax back in 2017 [DEP 0201]. Is this really worth it? It's only a *few lines of code* to keep backward compatibility,

Re: Removing url() ?

2020-05-05 Thread Collin Anderson
just fine on newer versions of Django. On Tuesday, May 5, 2020 at 1:04:02 PM UTC-4, James Bennett wrote: > > On Tue, May 5, 2020 at 8:42 AM Collin Anderson > wrote: > > Is this really worth it? It's only a few lines of code to keep backward > compatibility, and it seems

Getting rid of url()

2020-05-05 Thread Collin Anderson
Hi All, Are we ok getting rid of url()? Yesterday url() was officially slated for removal in [ticket #31534], and I know it was discussed and agreed upon back in [2017], even in a DEP, but I feel like the amount of work it would take to maintain the [shim] is near zero, and the total amount of

Re: Removing url() ?

2020-05-05 Thread Collin Anderson
> I don't think that we can revert [1] without a technical board approval Needing technical board approval to keep url() seems fair to me. I think most of the 2522559 changes are ok. I'd be fine if we only made these changes: https://github.com/django/django/compare/master...collinanderson:kee

Re: Removing url() ?

2020-05-05 Thread Collin Anderson
) is actually removed. I feel like collections.abc is a much rarer thing, however, pretty much every Django project that started pre 2.0 uses url(). On Tuesday, May 5, 2020 at 4:39:35 PM UTC-4, James Bennett wrote: > > On Tue, May 5, 2020 at 1:05 PM Collin Anderson > wrote:If it were

Re: Adding a security concerned feature

2020-11-25 Thread Collin Anderson
Hi All, I think at minimum we should change the default admin url for new projects, as that's very easy to do, and it does provide a lot of value for new projects. This helps Django to be secure by default. I use the default /admin/ url for my projects and bots are regurarly trying different p

Re: Adding a security concerned feature

2020-12-02 Thread Collin Anderson
, we > recommend you change that"? > > I think the combination of blocking IPs and having a different admin URL > would raise the bar quite a bit. > > -A > > On Wed, Nov 25, 2020 at 6:51 AM Collin Anderson > wrote: > >> Hi All, >> >> I think a

Re: Quick Filter in the Admin Sidebar

2020-12-02 Thread Collin Anderson
I think this would be really helpful. Looking at the code in the gist, that looks about right. It's not too complicated and the basic toLowerCase()/indexOf() method of search should hopefully be enough (it's what I would do if I were implementing this!). I'd suggest adding some sort of clear or

Re: Automatic prefetching in querysets

2017-08-15 Thread Collin Anderson
Hi Gordon, How is it implemented? Does each object keep a reference to the queryset it came from? Collin On Tue, Aug 15, 2017 at 2:44 PM, Gordon Wrigley wrote: > Sorry maybe I wasn't clear enough about the proposed mechanism. > > Currently when you dereference a foreign key field on an object

Re: Automatic prefetching in querysets

2017-08-17 Thread Collin Anderson
"turn it on/off per model" - I wonder if we just have a custom manager/mixin for the per model case. objects = AutoPrefetchRelatedManager(). The manager can return a queryset with prefetch_related(auto=True) or whatever already applied. On Thu, Aug 17, 2017 at 1:33 PM, Andrew Godwin wrote: > Jus

Re: Automatic prefetching in querysets

2017-08-18 Thread Collin Anderson
I like that idea - keep it a private API for now and make it a public API once people have used it a little bit. On Fri, Aug 18, 2017 at 4:01 AM, Shai Berger wrote: > On Friday 18 August 2017 09:08:11 Anssi Kääriäinen wrote: > > Maybe we should just add the queryset method. This is the smallest

Re: To keep or not to keep: logging of undefined template variables

2017-08-24 Thread Collin Anderson
I used to do that too (string_if_invalid that raises an exception). What was nice about this, is you could explicitly wrap the variable in an if tag to silence the error if you were ok with it. (I'm not sure if this behavior is still true.) {% if var_that_sometimes_exists %}{{ var_that_sometimes_e

Re: I would like to discuss my proposal for a working way to call .add() on an m2m with through= model

2017-08-26 Thread Collin Anderson
Hi All, I have a pull request for simple add()/create() etc with m2m through tables if any wants to try it out: https://github.com/django/django/pull/8981 If people are happy with the API, I'll add the docs too. Collin On Mon, Apr 17, 2017 at 3:53 PM, Luis Masuelli wrote: > I'm quite happy t

Re: drop support for MySQL 5.5 in Django 2.0?

2017-08-30 Thread Collin Anderson
As a datapoint for MySQL, Most of my websites are on Ubuntu 16.04 (Python 3.5, MySQL 5.7), though I do have one on 14.04 (Python 3.4, MySQL 5.5) that I _would_ upgrade to Django 2.0 if we kept 5.5 support, but it's not a big deal to leave it at 1.11 until I switch to 16.04. On Sat, Aug 26, 2017 at

Re: New Feature: Allow password reset token to expire in under a day

2017-09-21 Thread Collin Anderson
Seconds is consistent with all of the other settings, even for long ones like CSRF_COOKIE_AGE and SESSION_COOKIE_AGE. It also means you can avoid importing datetime in your settings file. On Thu, Sep 21, 2017 at 8:36 PM, Tom Forbes wrote: > It also seems odd to express it as seconds, it's often

Re: Templates: __html__ method support

2017-09-26 Thread Collin Anderson
I think this is a good idea. Django has used __html__ internally for the last 4 years so it's not something new [0]. I'm surprised this doesn't work out-of-the box. [0] https://code.djangoproject.com/ticket/7261 On Tue, Sep 26, 2017 at 9:26 AM, George-Cristian Bîrzan wrote: > On Tuesday, Septem

Re: Feature request: get_first_or_404

2017-11-28 Thread Collin Anderson
Is there a different between get_first_or_none() and the already existing first()? If we do first, some may want get_last_*() for everything too :) On Tue, Nov 28, 2017 at 8:31 PM, Josh Smeaton wrote: > From my experiences, all projects I've worked on have implemented > get_first_or_none and ge

Improving Backward Compatibility

2017-12-06 Thread Collin Anderson
Hi All, I think it would help if Django was better at *deprecations and backward compatibility*. I’ve brought this up [before ], but didn’t get any feedback, so here’s another try at it, with some *specific ideas of ho

Re: Proposal: make Model __unicode__() default to self.name

2017-12-12 Thread Collin Anderson
On the other hand, it does make sense to include the PK in __repr__, so I > would suggest backtracking on this change and making an equivalent change > in __repr__. > > On Saturday, April 8, 2017 at 8:41:56 PM UTC+2, Collin Anderson wrote: >> >> I just made a pull request. >

Re: Hello everyone I'm a new member

2017-12-18 Thread Collin Anderson
Yes, wait until at least 2019 to deprecate those. https://code.djangoproject.com/ticket/27753 On Mon, Dec 18, 2017 at 10:45 AM, Adam Johnson wrote: > Please don't do that, as I recall we'll just delete django.utils.six after > the minimum recommended django version for third party libraries is 2.

Re: ManytoMany Field save_form_data has not support for through table

2018-01-16 Thread Collin Anderson
Hi Andrew, Would allowing set() for through models help in your case? https://github.com/django/django/pull/8981 Thanks, Collin On Mon, Jan 15, 2018 at 5:14 PM, Andrew Standley < astand...@linear-systems.com> wrote: > Greetings, > I've been messing around with trying to update some custom

Re: ManytoMany Field save_form_data has not support for through table

2018-01-18 Thread Collin Anderson
Hi Andrew, Sure, do you want propose some tests? You could even open a new PR. Thanks, Collin 574-339-1060 On Thu, Jan 18, 2018 at 12:40 AM, Andrew Standley wrote: > Hi Collin, > The patch seems to work perfectly with intermediate models without > required fields. > > However looking over t

Re: Don't assume that missing fields from POST data are equal to an empty string value.

2018-01-23 Thread Collin Anderson
Maybe it would be helpful to have an option where it errors if (non-boolean) fields are non-existent in the POST data? (Though I have some GET-forms where I would not want that behavior) Maybe I could somehow set allow_missing_fields = True in that case? On Tue, Jan 23, 2018 at 4:56 AM, Tai Lee w

Re: Why Django render DateField type as text instead of date ?

2018-01-23 Thread Collin Anderson
Hi, The history of why is here: https://code.djangoproject.com/ticket/16630#comment:11 You can get type="date" like so on your form: birth_date = forms.DateField(attrs={'type': 'date'}, required=False) Thanks, Collin On Tue, Jan 23, 2018 at 12:43 AM, Ruchit Bhatt wrote: > Hi folks, > Here i

Re: DEP Pre-posal: Re-Designing Django Forms

2018-01-31 Thread Collin Anderson
I personally use the (undocumented?) formfield() method, which takes the model defaults and lets you override things. I think it's pretty elegant, though maybe it could use some less verbose syntax (maybe have a forms.ModelDefault(label='Note') that does this for you). class NoteModalForm(forms.Mo

Re: ticket 28404

2018-02-07 Thread Collin Anderson
Hi Carlton, There are some cases where I really do want an empty string displayed (though not in a linked column). Maybe only use it only when it's an auto-linked field/column? Or maybe only use this behavior in display_for_field()? (So if you use a custom function/method, you can still have full

Re: Thoughts re looser coupling of django.contrib.auth and django.contrib admin

2018-02-08 Thread Collin Anderson
Hi Steve, If it helps at least in the short-term, those fields currently don't need to be actual database columns. I have a custom user that has these properties/methods to make work with the admin. Collin @property def is_anonymous(self): return not self.is_authenticated @p

Re: Consider renaming `mark_safe` to `dangerously_trust_html` (etc)

2018-02-21 Thread Collin Anderson
> Maybe we could just alias and warn when using the old name, leaving a decision on deprecation until some time in the future. I'm a fan of delaying deprecation/removal if we do change it. :) On Wed, Feb 21, 2018 at 4:41 PM, Josh Smeaton wrote: > I agree that the names are misleading and we sho

Re: Raising awareness to issue #17664

2018-03-01 Thread Collin Anderson
"{% if %} template tag silences exceptions inconsistently" On Thu, Mar 1, 2018 at 8:57 AM, Robert Roskam wrote: > I spent some time looking at this issue last week, and I wanted to raise > awareness here. It's an issue that's been out there for 6 years, and I > think I have a path forward. > > H

Re: please make django model independent,i wanna use without full django project, thanks

2018-03-01 Thread Collin Anderson
Hello, Do you mean not use the entire django package? or not use an entire "project" directory as created by startproject? Why don't you want to use full django project? Thanks, Collin On Thu, Mar 1, 2018 at 5:31 AM, 王冯俊 wrote: > please make django model independent,i wanna use without full dj

Re: URL Query Params via Reverse.

2018-03-05 Thread Collin Anderson
Hi Matthew, Are you aware of Python's urlencode? https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode It sounds like you want something like: def reverse_with_querystring(viewname, data=None): return "{url}{querystring}".format(url=reverse(viewname), querystring='?' + ur

Re: Shouldn't manage.py call python3 instead of python?

2018-04-09 Thread Collin Anderson
I personally just edit my manage.py to change it from python to python3. Maybe we could just document that? (Or would it work to use os.path.basename(sys.executable) ?) On Sun, Apr 8, 2018 at 11:02 AM, Tom Forbes wrote: > It may be an obstacle but I believe it’s better than having them nuke > t

Re: Shouldn't manage.py call python3 instead of python?

2018-04-09 Thread Collin Anderson
k to use os.path.basename(sys.executable) ?) > > > The shebang is interpreted by the OS so this is before python even starts > :) > > On 9 April 2018 at 20:53, Collin Anderson wrote: > >> I personally just edit my manage.py to change it from python to python3. >> Maybe we

Re: Shouldn't manage.py call python3 instead of python?

2018-04-11 Thread Collin Anderson
but python3 manage.py doesn't work on windows, right? On Tue, Apr 10, 2018 at 10:17 PM, Josh Smeaton wrote: > As a datapoint, I've seen roughly 1 person per week in #django IRC > confused about specific startup exceptions due to them using python 2 > rather than python 3 on Django >= 2.0. Unsur

Re: Fabric examples in documentation

2018-04-25 Thread Collin Anderson
A little bit more information: Fabric2 has been actively developed over the last year, but is still Alpha (may get api changes): https://github.com/fabric/fabric/tree/v2 http://bitprophet.org/blog/2017/04/17/fabric-2-alpha-beta/ I agree removing references to fabric might be the way to go. There a

Re: ModelAdmin.prepopulated_fields removes stop words

2018-04-25 Thread Collin Anderson
Hi Kelly, I believe it's in urlify.js https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js#L172-L175 Collin On Wed, Apr 25, 2018 at 4:51 PM, Kelly wrote: > Hello, > > I am working on ticket 29351 > and I am d

Re: #django-dev IRC channel

2018-04-27 Thread Collin Anderson
Hi Kenneth, The Contributing to Django page is part of the Django's main documentation, so open a ticket for django: https://code.djangoproject.com The source for that page is here: https://github.com/ django/django/blob/master/docs/

Re: email login, create and save

2018-05-04 Thread Collin Anderson
Do you want something like this? class EmailUserCreationForm(UserCreationForm): username = User._meta.get_field('username').formfield(label='Email', validators=[validators.validate_email]) def save(self, commit=True): self.instance.email = self.cleaned_data['username'] ret

Re: Set formfield.initial when created using modelformset_factory

2018-05-23 Thread Collin Anderson
Hi Brock, Yes, that's the intended behavior, and you can see the same behavior on a regular form, without using formsets, which might make it a little more clear what's going on: class MyForm(forms.Form): name = forms.CharField() form = MyForm(initial={'name': 'test'}) form.initial #yields

<    1   2   3   >