Restoring deleted entries with db_constraint = False

2016-04-07 Thread Olivier Dalang
e to know whether I'm on the verge of doing something stupid ;) Thanks ! Olivier Dalang -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubs

Force a model to appear on admin's index page depending on the request

2016-04-13 Thread Olivier Dalang
Hi ! Is it possible to force a model to appear on the admin index page depending on the request ? I'm asking because I did override the has_change_permission() method of the ModelAdmin, so that the user can be allowed to change some instances (chosen via a ManyToMany relationship between the

Django and jQuery, I don't get it

2016-06-09 Thread Olivier Dalang
Hi ! I'm using several modules that rely on jQuery, and have some own needs as well : - admin > - grappelli > - autocomplete light > - session security > ... I also see that there are tons of different variables that reference jQuery, defined by theses modules, some of which are the same, and

Display old instances as read only in admin inlines

2016-06-17 Thread Olivier Dalang
Dear List, I'm a bit stuck on a problem. I googled a lot, but didn't find an answer. I have a "Loan" model and a "Payment" model. In the admin, I display the payments for each loan in inlines. I want payements that are more than 3 days old to be displayed as readonly, as they are considered to

Re: Repetitve/Infinite migrations generated on ManyToManyField

2016-10-27 Thread Olivier Dalang
Hi, I noticed this behavior when changing the case of a app/model/field name. See if the name has the same case in the initial creation migration and in the model. Cheers, Olivier On 27 Sep 2016 03:39, "Marvin Mednick" wrote: > I've the the following models related to a

Re: Adding view permission by default to auth_permission

2016-10-29 Thread Olivier Dalang
Indeed I just have to squash the commits then it can be merged. I'm out of office until next week but will do so when back. Bests On 27 Oct 2016 23:23, "Luis Zárate" wrote: > This is alive in > > https://github.com/django/django/pull/6734 > > The other PR was close because

Re: Read Only by user in Django Admin

2016-10-28 Thread Olivier Dalang
Hi, The following PR is ready to merge and implements this: https://github.com/django/django/pull/6734 I will squash the commits as soon as I'm back in the office (next week) and it will probably be merged soon. Bests Olivier On 25 Oct 2016 19:03, "Luis Zárate" wrote: >

django admin ajax file upload

2017-05-09 Thread Olivier Dalang
Hi ! Here we use Django admin as main input interface for our staff in the field. Our models have image fields, where the staff directly loads images from the camera. There are two main problems : - the form is very slow to submit, as everything is uploaded at once, at the very end, even if

app's post-migrate triggers work only with pip's -e flag

2018-02-08 Thread Olivier Dalang
Dear List, I'm currently trying to deploy a Django 1.8 app and run into a strange problem. My app defines a post-migrate trigger in apps.py : # apps.py class MyAppConfig(AppConfig): ... def ready(self): print('Debug : installing the post-migrate callback') post_migrate.connect(my_callback,

Re: app's post-migrate triggers work only with pip's -e flag

2018-02-08 Thread Olivier Dalang
Well it was some deleted file's .pyc lying around (models.pyc which was triggering migrations) :/ Sorry for the noise ! Kind regards, Olivier On Fri, Feb 9, 2018 at 10:32 AM, Olivier Dalang <olivier.dal...@gmail.com> wrote: > Dear List, > > I'm currently trying to deploy a

Re: tasks queues - why a broker and not the DB?

2019-01-16 Thread Olivier Dalang
So, unless the project has a really enormous amount of tasks, there's no other reason than not overload the db ? I'm a bit surprised as I feel like for most projects, reading/writing the tasks queue represents a very small load compared to regular db access. In the meantime, I found about

tasks queues - why a broker and not the DB?

2019-01-15 Thread Olivier Dalang
Hi ! I'm currently comparing task queues solutions for Django, and was wondering why all of them seem to require a broker (rabbitmq, redis...), including the ones that are supposedly lightweight/not full featured (huey...), and including the ones that are made for Django exclusively

Annotations as models fields

2019-06-06 Thread Olivier Dalang
Dear list, I was wondering whether there's a package or pattern to define annotations as model fields, so that they could really be used as database-side computed fields. Currently, I do something like this (not tested, it's a simplified case): class SalesManager(models.Manager): def

Re: Annotations as models fields

2019-06-06 Thread Olivier Dalang
ustom-model-fields/ > > > Regards, > Chetan Ganji > +91-900-483-4183 > ganji.che...@gmail.com > http://ryucoder.in > > > On Thu, Jun 6, 2019 at 3:36 PM Olivier Dalang > wrote: > >> Dear list, >> >> I was wondering whether there's a package or pat

Re: Annotations as models fields

2019-06-06 Thread Olivier Dalang
> > > class Sales(models.Model): > buying_price = models.FloatField() > selling_price = models.FloatField() > profit = models.models.FloatField() > > > Cheers! > > > Regards, > Chetan Ganji > +91-900-483-4183 > ganji.che...@gmail.com > http://ryucoder.in

Customizable model field (such as SRID for geometries) and migrations

2021-06-02 Thread Olivier Dalang
Dear List, I'm working on a Django app whose models have geometry fields and that will be deployed in several geographic locations. Using a globally available reference system (WGS84) and reprojecting on the fly will not work due to performance and accuracy implications for geometric queries.