Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread Anssi Kääriäinen
I was assuming that the Index class would be responsible for generating the whole SQL. Seems like this isn't the case. I assumed something like this would happen when a new index is added: 1. User adds a new BTreeIndex to a model 2. The makemigrations command detects a change and creates a

Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread Anssi Kääriäinen
On Thu, Mar 10, 2016 at 8:17 AM, Markus Holtermann wrote: > Hi Akshesh, > > thank you for your proposal! Sounds like a good plan. > > On Thursday, March 10, 2016 at 8:16:10 AM UTC+11, akki wrote: > >>> Once the index is added to a model, the model can inject itself into

Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread akki
Hi I have updated my proposal and completed the timeline. I saw how expressions work and now have a clear idea of how they would be used in indexes - I have added a short description of the same in my proposal. Please have a look. I would

Re: Django startproject template enhancement proposal

2016-03-14 Thread aRkadeFR
FMPOV, the default template from Django influences: - the use of settings in .py files over the environment variables; - the use of manage.py over django-admin command; - the merge of the "core application" and the project (settings/wsgi...) in one django app; This is very personal and based

Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread akki
Hi Annsi Yes, the AddIndex operation would detect the changes and the user would not have full control over the generated SQL. I don't know if it would be a good idea to mix index definitions with fields while creating models. Users have traditionally been defining fields that way and indexes

Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread Michal Petrucha
On Mon, Mar 14, 2016 at 12:45:09AM -0700, akki wrote: > Hi Annsi > > Yes, the AddIndex operation would detect the changes and the user would not > have full control over the generated SQL. > > I don't know if it would be a good idea to mix index definitions with > fields while creating models.

Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread Marc Tamlyn
I like this a lot. Even we we then keep the "Meta" options as they are forever, they then become shortcuts to what you could define explicitly. In any case, we would need some careful checks that (for example) you can't have identical indexes defined in multiple ways with the same names. On 14

Re: Proposal on Custom Indexes - Google Summer of Code

2016-03-14 Thread akki
> > > you can't have identical indexes defined in multiple ways with the same > names. > Yes, I will be checking for the duplications at the autodetector level itself. We need to take care that no two indexes are for the same fields, and none of them have a clashing name. On such an

Re: Django startproject template enhancement proposal

2016-03-14 Thread James Pic
That sounds pretty fair, particularly since the new default settings provide a great ootb experience. Thanks for your feedback, keep up the great work ! -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To

MySQL data loss possibility with concurrent ManyToManyField saves

2016-03-14 Thread Tim Graham
Could some MySQL users take a look at ticket #26347 [0] and recommend how to proceed? I think it's probably not a new issue but I'm a bit surprised it hasn't come up before if so. [0] https://code.djangoproject.com/ticket/26347 -- You received this message because you are subscribed to the

Re: TransactionManagementError is raised when autocommit …

2016-03-14 Thread Tore Lundqvist
I recently upgrade Django 1.7->1.8 and ended up needing to patch set_rollback() and comment out the "exception if not in an atomic block" part. The problem was that sometimes database errors like IntegrityError occurred because multiple workers was trying to create the same data but that's

Re: TransactionManagementError is raised when autocommit …

2016-03-14 Thread Jeremy Dunck
You can use atomic just over the section that causes the error. The issue is that different db engines have different semantics under error during transaction. Rolling back to the last savepoint (as atomic does when nested) recovers the ability to complete the remainder of the transaction. With a

Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-03-14 Thread James Bennett
Personally I've long been in favor of drastically simplifying the email regex and essentially telling people that if they want to support triply-nested comments in a bang-path address they can write their own :) Is there an actual compelling reason to not just pare it down to "word characters

How to extend admin/user to adapt it to my business problem

2016-03-14 Thread iherrera
I have to save other information of users but i want to use the users that are created in the admin in django how can i do that ?? i am sorry if this is a basic question but i am a beginner in django -- You received this message because you are subscribed to the Google Groups "Django

Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-03-14 Thread Michael Manfre
Simple is better. Anyone who needs/wants something more complex is not prevented by Django from doing so. Regards, Michael Manfre On Mon, Mar 14, 2016 at 2:31 PM, Aymeric Augustin < aymeric.augus...@polytechnique.org> wrote: > Indeed, for some reason, the URL and email validators get anywhere

Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-03-14 Thread Florian Apolloner
On Monday, March 14, 2016 at 8:08:09 PM UTC+1, Michael Manfre wrote: > > Simple is better. Anyone who needs/wants something more complex is not > prevented by Django from doing so. > +1 to that and what the rest said ;) > > Regards, > Michael Manfre > > On Mon, Mar 14, 2016 at 2:31 PM,

Re: Translate permission Django

2016-03-14 Thread Collin Anderson
Maybe we could have __str__ run the text through _()? I don't do much translating. On Mon, Mar 7, 2016 at 10:21 AM, Tim Graham wrote: > This has been discussed in several tickets ( > https://www.google.com/search?=translate+permissions+site%3Acode.djangoproject.com) > and

Re: Translate permission Django

2016-03-14 Thread Florian Apolloner
On Monday, March 14, 2016 at 9:24:30 PM UTC+1, Collin Anderson wrote: > > Maybe we could have __str__ run the text through _()? I don't do much > translating. > Wouldn't work since you'd still need the static strings for the po files somewhere. -- You received this message because you are

Re: MySQL data loss possibility with concurrent ManyToManyField saves

2016-03-14 Thread Cristiano Coelho
The django-admin interface is quite bad at handling concurrent modifications, this is one problem that might not happen on other backends and is quite critical, but other issues (that ain't critical like data loss but might cause unexpected errors) like two people viewing a model with some

Re: MySQL data loss possibility with concurrent ManyToManyField saves

2016-03-14 Thread Shai Berger
Hi, I just commented on the ticket, but wanted to clarify a few things here: On Tuesday 15 March 2016 00:48:02 Cristiano Coelho wrote: > The django-admin interface is quite bad at handling concurrent > modifications, this is one problem that might not happen on other backends > and is quite

Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-03-14 Thread Josh Smeaton
+1. I don't think we need strict email validation. "looks vaguely like an email address" is enough for validation purposes in forms. Are there any security concerns we need to be aware of though? On Tuesday, 15 March 2016 05:17:15 UTC+11, James Bennett wrote: > > Personally I've long been in

Re: Translate permission Django

2016-03-14 Thread Ramez Ashraf
Hello, I created a 3rd party app for this issue , which will also display the app and model verbose names + display permissions in a tabular format for more easy setting when you have dozens of models. Check it out at https://github.com/RamezIssac/django-tabular-permissions Hope it helps :-)

Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-03-14 Thread Florian Apolloner
On Tuesday, March 15, 2016 at 12:29:42 AM UTC+1, Josh Smeaton wrote: > > +1. I don't think we need strict email validation. "looks vaguely like an > email address" is enough for validation purposes in forms. Are there any > security concerns we need to be aware of though? > Absolutely, the

Re: Django startproject template enhancement proposal

2016-03-14 Thread Curtis Maloney
Well, you could use: mkdir my_client_name django-admin startproject project my_client_name/ So it will create my_client_name/project/settings.py, and leave the namespace clear for you to create my_client_name/my_client_name/ as your app... -- Curtis On 15/03/16 10:51, Ramez Ashraf wrote:

Re: MySQL data loss possibility with concurrent ManyToManyField saves

2016-03-14 Thread Cristiano Coelho
I can't tell if it is a bug on MySQL or not, but I did understand the same as you (the first example with Session A and Session B makes it more clear) so I can't quite understand how did the poster get that issue. I would like a similar example as the one in the docs, but with a delete in the

Re: Django startproject template enhancement proposal

2016-03-14 Thread Ramez Ashraf
That's a solution :-) Thanks! I personally create my projects/apps via a script with customized templates. But for new comers, they will suffer from adding "_app" to their main app. I know i did at one point.:-) All the best. On Tue, Mar 15, 2016 at 2:26 AM, Curtis Maloney

Re: thinking about the admin's scope and its description in the docs

2016-03-14 Thread Ramez Ashraf
Like what is "site front end" that the admin shouldn't replace ?! I work with business application where clients puts data in and get reports back... (Like Sales/Store/Client balances and stuff) I tried to work "my front end" (after getting the bad/wrong message from the docs) but it was so much

Re: thinking about the admin's scope and its description in the docs

2016-03-14 Thread James Pic
On Tue, Mar 15, 2016 at 1:59 AM, Ramez Ashraf wrote: > > 1. Inlines (FormView is like a teenager playing in the park next to Spartan > Hero) There are inlinemodelformsets you can use outside the admin. > 2. Entry Log change message django-activity-stream or even

Re: Value of tightening URLValidator/EmailValidator regular expressions?

2016-03-14 Thread Markus Holtermann
On Mon, Mar 14, 2016 at 12:34:40PM -0700, Florian Apolloner wrote: On Monday, March 14, 2016 at 8:08:09 PM UTC+1, Michael Manfre wrote: Simple is better. Anyone who needs/wants something more complex is not prevented by Django from doing so. +1 to that and what the rest said ;) +1 As