Re: ModelAdmin Media JS file order issue in Django 2.0

2017-12-10 Thread Marc R
; using Python ? > > Etienne > > Le 2017-12-10 à 09:30, Marc R a écrit : > > I have this in my model: > > class Media: > js = ( >* '/static/plugins/codemirror/lib/codemirror.js',* > '/static/plugins/codemirror/mode/html

ModelAdmin Media JS file order issue in Django 2.0

2017-12-10 Thread Marc R
I have this in my model: class Media: js = ( * '/static/plugins/codemirror/lib/codemirror.js',* '/static/plugins/codemirror/mode/htmlmixed/htmlmixed.js', '/static/plugins/codemirror/addon/fold/foldcode.js', '/static/plugins/codemirror/addon/fo

Re: Passing filter parameters to admin's add view

2013-05-26 Thread Marc R
Sorry, didn't read to the bottom of your post :) Why would there be a better way than overriding the default template? that is the most efficient way and the power of frameworks. On Saturday, May 25, 2013 11:53:00 AM UTC-4, Branko Majic wrote: > > Hello all, > > I've posted a similar question

Re: Passing filter parameters to admin's add view

2013-05-26 Thread Marc R
override the template and change it accordingly (you can grab djangos as a starting point). Google for django admin template override. On Saturday, May 25, 2013 11:53:00 AM UTC-4, Branko Majic wrote: > > Hello all, > > I've posted a similar question a couple of months ago, but received no > a

Re: Is there a way to tell an instance was saved without checking instalce.pk or doing a db lookup?

2013-05-26 Thread Marc R
What are you trying to accomplish? I believe the doc's talk about this some; but in short, you can only check the pk if its a new object; otherwise the pk would be set (if you retrieved the object from the database, or saved before). I would assume (as i've not run into the issue yet) that on

another ifchanged question, triggers on first call, not what I want

2013-05-26 Thread Marc R
I'm trying to insert breaks when a row value in a specific column of data changes; however, it is triggering on the very first call to "ifchanged". For example: {% for row in report %} {% ifchanged row.column2 %} {% endifchanged %} ...print other data... {% endfor %} The very first line is a

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Marc R
Anyone? I would really like to know who I can modify the query as its being built so that for a specific field I can set the "field" to AES_DECRTYP(fieldname,key) on a select and AES_ENCRYPT(fieldname,key) on insert/update On Sunday, 28 April 2013 20:21:48 UTC-4, Marc R wrote: &g

Admin module - modify SQL Query used for Edit and Save Models

2013-04-28 Thread Marc R
I have a model where I have used AES_ENCRYPT(value, key) to save data in a MySQL database. It is set as a varbinary field. So the issue is; when trying to edit the model in Django, it does not render a widget for the field. I've tried the aesfield from github but that does some funky thing wit

Re: ManyToMany relationship and raw sql queries

2013-04-27 Thread Marc R
did you use Bookmark.objetcs.all().select_related() ? As this will create a join query... at least for your model you show in the message I have found that for very complex joins, you need to use raw query and not a Model. On Thursday, April 25, 2013 10:44:28 AM UTC-4, Matthieu Bouron wrote

Re: Django Admin - BooleanField issue

2013-04-27 Thread Marc R
ndrew Boltachev wrote: > > Hi. May be you need > > active = models.BooleanField(choices=((True,'yes'),(False,'no'))) > > ? > > - With regards, Andrei > > > 2013/4/27 Marc R > > >> I've setup a boolean field and get it to display co

Django Admin - BooleanField issue

2013-04-27 Thread Marc R
I've setup a boolean field and get it to display correctly using this in my model: active = models.BooleanField(choices=((1,'yes'),(0,'no'))) However, when I edit a record in the Django Admin, the select field always shows "yes" regardless of the database value. Saving "yes" or "no" stores the