Re: Struggling with pulling information out of a class in models.py (Thank you in advance for any help!)

2018-04-18 Thread Derek
You will need to gve an example of your struggles (witth code being used to pull info, and with error traces) before we can help; all you have shown is model code. On Sunday, 15 April 2018 05:55:21 UTC+2, coreyj...@gmail.com wrote: > > Dear all, > > I am really struggling with pulling informat

Re: New to Python

2018-05-17 Thread Derek
In addition to Beautiful Soup, you probably need Requests (http://docs.python-requests.org/en/master/). Some examples of using these together: https://gist.github.com/bradmontgomery/1872970 https://www.digitalocean.com/community/tutorials/how-to-work-with-web-data-using-requests-and-beautiful-s

Definitive (or any) guide to testing Django admin actions with intermediate pages?

2018-05-28 Thread Derek
essages framework. ** for purpose of this question, its safe to assume that all logic for the action is included in it as a single whole. Any help with this is appreciated - its the one part of testing that just eludes me. Derek -- You received this message because you are subscribed to the Goo

Re: Help with testing of custom Django admin actions

2016-04-24 Thread Derek
Thanks; I understand the testing approach and its working well in other parts of my project. I was looking for something more specifically related to testing custom admin actions though. On 24 April 2016 at 00:33, Camilo Torres wrote: > On Thursday, April 21, 2016 at 9:16:25 AM UTC-4:30, De

Re: What's the best way to auto convert a model field values before it is rendered?

2016-05-03 Thread Derek
I would add it as a custom model method - see: https://docs.djangoproject.com/es/1.9/topics/db/models/#model-methods So, for example: class Temperature(models.Model): user = models.ForeignKey(User, unique=False) celcius = models.FloatField(null=True, blank=True) def _get_fahrenh

Re: What's the best way to auto convert a model field values before it is rendered?

2016-05-05 Thread Derek
The '_get_fahrenheit()' method will also need to handle the case of a null entry for the 'celcius' field. On Tuesday, 3 May 2016 16:34:20 UTC+2, Derek wrote: > > I would add it as a custom model method - see: > https://docs.djangoproject.com/es/1.9/topics/db/mode

Re: multiple INSERT with django form

2016-05-09 Thread Derek
You might want to consider using a jQuery plugin like appendGrid (http://appendgrid.apphb.com/); and then writing the necessary logic for the view that allows you to construct the grid and then process data from it (http://stackoverflow.com/questions/3670206/django-with-jquery-basic-help provi

Re: is there any django app for opendata

2016-05-20 Thread Derek
Not to discourage you, but there is already a large Python project called CKAN that tries to do exactly that: make data open and transparent. Its built on Pylons and SQLAlchemy, but maybe it will suit your needs, and maybe you can contribute to improving it, rather than starting a new project f

Re: PDF page break

2016-05-23 Thread Derek
You need to let the list know what formats and what technology you are using to generate the PDF. When I use rst (reStructuredText) as my input to the generation process, the markup I use for a Page Break is: .. raw:: pdf PageBreak On Sunday, 22 May 2016 10:57:15 UTC+2, Monu wrote: > >

Re: get all columns as a list

2016-05-23 Thread Derek
*"When new data comes in I want to ... only add a new row if it differs."* Pardon my curiosity, but isn't that the role of the set of unique keys for each record - to determine if it is "different"? On Friday, 20 May 2016 19:57:38 UTC+2, larry@gmail.com wrote: > > On Fri, May 20, 2016 at 2:2

Re: Displaying a document

2016-05-23 Thread Derek
The users will need a browser which is capable of rendering the file or knowing what app it has to use - for example, on my machine (Linux) an XLS file is rendered directly by LibreOffice; but on a colleague's machine with Windows/IE they have to first download the file and then open it. So, you

Re: get all columns as a list

2016-05-23 Thread Derek
> > On Mon, May 23, 2016 at 4:53 AM, Derek > > wrote: > > "When new data comes in I want to ... only add a new row if it differs." > > > > Pardon my curiosity, but isn't that the role of the set of unique keys > for > > each record - to

Re: get all columns as a list

2016-05-24 Thread Derek
t are the same > (excluding the timestamp) I don't want to store the second one. > > On Mon, May 23, 2016 at 12:14 PM, Derek > > wrote: > > OK - I don't really understand that; there should not be any 2 identical > > records in a database, but anyway, that

Re: get all columns as a list

2016-05-25 Thread Derek
, try to retain as much data as possible and archive it in preference to simply tossing it. On Wednesday, 25 May 2016 00:52:01 UTC+2, James Schneider wrote: > > > On May 24, 2016 9:11 AM, "Derek" > wrote: > > > > Interesting. In all the cases I can think of, I wo

Re: Django Beginner

2016-05-27 Thread Derek
For OOP concepts, have a look at: http://learnpythonthehardway.org/book/ex40.html (The whole book is online and is useful even for reminding yourself about things you may already know something about e.g. dictionaries; and it is good at explaining - honestly, how many CS books have headers like

Re: Django Models

2016-05-27 Thread Derek
There a number of designs for similar situations online; a quick Google showed me: * http://www.databasedev.co.uk/student_courses_data_model.html * http://databaseanswers.org/data_models/ And I am sure there are more... If this is your first project. I would not be too fussed about making it

Re: Adding view permission by default to auth_permission

2016-06-01 Thread Derek
My own observation, from years on this mailing list, is that the dev team do not consider this a must-have for Django; their view (as far as I understand it!) is that the admin is designed for trusted users, so simply do not let them have access at all. Having said that, there is a pull reques

Re: change display value of filter in admin

2016-06-01 Thread Derek
You need to use a Django SimpleListFilter; e.g. see http://gpiot.com/blog/django-cookbook-custom-admin-list-filters/ or https://www.elements.nl/2015/03/16/getting-the-most-out-of-django-admin-filters/ On Tuesday, 31 May 2016 13:52:06 UTC+2, Brad Rice wrote: > > I have a field that has two values

Re: Drawing simple objects in Django using canvas

2016-06-01 Thread Derek
My sense is that javascript for this type of application *is* going to be complex; but if you need, you will have to learn it. There's also go.js - e..g http://gojs.net/latest/learn/index.html On Monday, 30 May 2016 01:24:16 UTC+2, Nemanja Milosavljevic wrote: > > > > down votefavorite >

Test fails when run in whole test suite - but not stand-alone?

2016-06-02 Thread Derek
from anyone who can spot an obvious mistake - or suggest some options to explore. Thanks Derek # THIS IS AN EXTRACT OF RELEVANT CODE (not all of it...) from django.contrib.messages.storage.fallback import FallbackStorage from django.core.urlresolvers import reverse from django.test import TestCase, C

Re: Test fails when run in whole test suite - but not stand-alone?

2016-06-08 Thread Derek
, > it's a case that a test changed something and I just have to add in the > teardown function to restore the state of whatever was changed. > > On Thu, 2016-06-02 at 21:33 +0200, Derek wrote: > > I have a test that is failing when the file it is in is run as part of all

Re: Autocomplete for Admin search field

2016-06-08 Thread Derek
I have not done this; but I think you would need to overwrite the default Django template and add in a special widget (such as the django-autocomplete- light one). Bear in mind you'd also need to handling searching across multiple fields. On Wednesday, 8 June 2016 14:08:54 UTC+2, Александр Жид

Re: Absolute beginner step by step

2016-06-11 Thread Derek
The Django tutorial - https://docs.djangoproject.com/en/1.9/intro/tutorial01/ But if you have no Python experience at all, then http://learnpythonthehardway.org/book/ (otherwise you'l get lost quickly) And for both sets of learning, bear in mind the key advice from Zed Shaw: *"You must type e

Re: Absolute beginner step by step

2016-06-15 Thread Derek
If you are getting syntax errors, it is best to post the relevant code here, along with the Python stack trace. English is usually not good at describing programming errors. On Tuesday, 14 June 2016 23:56:02 UTC+2, Mc. Holid wrote: > > Dear All > > It seem this is the best starting guide for me,

Re: Absolute beginner step by step

2016-06-20 Thread Derek
"Django is supposed to be completely backward compatible" Er, no, its not and they never promised it would be. You need to check the changes made for each release - as they say here: https://docs.djangoproject.com/en/1.9/releases/ "you will need to check *all* the backwards-incompatible change

IntegrityError for unique_together ?

2016-06-23 Thread Derek
y an attempted save from within the admin does not call full_clean() or attempt to trap an IntegrityError? I should add that `city` field is not on the form to be filled in; and is added in the clean method. What is the best / correct solution to this? Thanks! Derek Traceback: File "/home/d

Re: IntegrityError for unique_together ?

2016-06-23 Thread Derek
Thanks Simon Those definitions are the closest I can get to the original in terms of type and relationship; what other info is needed? That ticket refers to child models inline - not my situation. Upgrading is on the cards - but still has to be budgeted for Derek On 23 June 2016 at 21:26

Re: Test fails when run in whole test suite - but not stand-alone?

2016-06-25 Thread Derek
ttest from trees.admin import AnyModelAdmin class TestDummy(unittest.TestCase): def setUp(self): pass def test_dummy(self): pass def tearDown(self): pass Then I get errors. Do you know why an import statement would interfere with a test? Thanks, Derek

Re: Additional magic with methods of a classes

2016-07-03 Thread Derek
This is not a clear problem. If English is not easy for you, then perhaps add a code sample or two to show what you mean? On Sunday, 3 July 2016 11:55:34 UTC+2, Seti Volkylany wrote: > > Django`s methods may can only method_name.short_description, > method_name.boolean and method_name.admin_ord

Re: django data insertion into database

2016-07-11 Thread Derek
Looks like the lines in your code, from # forms onwards need to be outdented (so the "class" statements are at matching levels). On Monday, 11 July 2016 08:34:44 UTC+2, Ikram Ulhaq wrote: > > hi everyone! > i am new in django web development.i want to insert data into my database > using followi

Re: How do I fetch table values in pdf using django?

2016-07-12 Thread Derek
Here's a good tutorial: https://assist-software.net/blog/how-create-pdf-files-python-django-application-using-reportlab On Tuesday, 12 July 2016 13:29:00 UTC+2, Aslam Sha wrote: > > > How do I fetch table values in pdf using django? > > ** I AM USING REPORTLAB FOR PDP* > -- You received this m

Re: Easiest way to ajax enable django forms

2016-07-14 Thread Derek
Not surprisingly, someone (well, more than one someone, actually) has already done this: https://realpython.com/blog/python/django-and-ajax-form-submissions/ or http://stackoverflow.com/questions/14099038/an-easy-way-to-submit-django-forms-using-ajax-jquery or https://aliteralmind.wordpress.com/2

Re: Dynamic ModelAdmin Field

2016-07-15 Thread Derek
Why not use custom methods on your model? These can effectively act as extra properties: *https://docs.djangoproject.com/en/1.9/topics/db/models/#model-methods*(this is assuming you do not want to store any data of course... otherwise you will need to give a more concrete example of what you

Re: Disabling migrations when running tests

2016-07-17 Thread Derek
I use a small "hack" which Works For Me :) I use a shell script to run the tests (call it, for example, `tester.sh`) :- mv myapp/fixtures myapp/_fixtures python manage.py test --traverse-namespace tests --settings=test_settings mv myapp/_fixtures myapp/fixtures So; basically rename the fixtures

Re: Disabling migrations when running tests

2016-07-17 Thread Derek
Please ignore this! My apologies - I read "fixtures" instead of "migrations". On Sunday, 17 July 2016 15:13:05 UTC+2, Derek wrote: > > I use a small "hack" which Works For Me :) > > I use a shell script to run the tests (call it, for example, `tes

Re: Real-Time Data Streaming

2016-07-20 Thread Derek
You may not actually need Django in this mix - e.g. http://xingwu.me/2014/10/19/Real-time-Web-Dashboard-Using-Socket-io-and-Highcharts/ On Monday, 18 July 2016 21:49:48 UTC+2, pvmer...@gmail.com wrote: > > Hello Everyone, > >I am working on a project where I want to display/plot graphs in >

Re: Question has mediated relation to the Django.

2016-07-22 Thread Derek
I don't know how to do this in "raw" Python; but my view is that the Python universe is full of very smart programmers who have wrapped their knowledge into libraries for you to use - so why not make use of them, rather than reinventing the wheel yourself? In short: https://pythonhosted.org/Py

Re: When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-23 Thread Derek
https://docs.djangoproject.com/en/1.9/topics/db/managers/#modifying-a-manager-s-initial-queryset Note the difference between overriding the default queryset (called "objects" by Django) vs creating your own - in the example shown, it is called "dahl_objects" (but of course should be a name that

Re: When it make sense to use a different name for a custom manager of the Django`s model?

2016-07-24 Thread Derek
et_queryset().filter(code='mine') and then in your model: objects = models.Manager() # the default manager mine = MinePollManager() # choose name that is appropriate for your app/use Hope this clarifies. On Saturday, 23 July 2016 16:58:09 UTC+2, Seti Volkylany wrot

Re: New to Django

2016-08-18 Thread Derek
In your template you call this: for server, images in child_list.items Which is fine, but then you call this: for image, number in images.items But there is no variable called "images" I think it should be "image_list:. HTH Derek On Tuesday, 16 August 2016 02:22:28 U

Re: Strange failing test

2016-08-24 Thread Derek
Assuming that the long function you have embedded inside your dictionary simply generates a list i.e. cloned_build.groupings.get(group=group1) .field_values .exclude(template=approvable_template) .values_list('id', flat=True)[:] results in: [1,2,3] Then some examples of possible t

Re: Postcode Search

2016-08-24 Thread Derek
The Google geocoding API can help - see: https://developers.google.com/maps/documentation/geocoding/intro Their example shows the ZIP code being returned in the JSON/XML response. Or there is: https://www.zipcodeapi.com/ Of course, you need to adhere to the terms&conditions of these service prov

Re: export html to pdf

2016-09-15 Thread Derek
There is a useful overview of different tools here: https://spapas.github.io/2015/11/27/pdf-in-django/ On Wednesday, 14 September 2016 16:46:57 UTC+2, Saeon Tao wrote: > > Hi guys, > > Does someone have a great suggestion for exporting an html div and save to > pdf? i have found many options, on

Re: Howto to create custom admin commands with subcommands

2016-09-21 Thread Derek
Sorry, I have not done this, but if you look at this section: https://docs.djangoproject.com/en/1.10/howto/custom-management-commands/#accepting-optional-arguments then at the end there is a link from the word "argparse" to this site: https://docs.python.org/3/library/argparse.html#module-argparse

Re: admin popup + button help

2016-10-20 Thread Derek
The article linked to is from 2008 - have some things not changed in Django since then? On Friday, 14 October 2016 15:22:12 UTC+2, David wrote: > > Hi Giuseppe, > I was upgrading to a later version of django and ran into the same issue. > Did you find a work-around? > > On Wednesday, April 27, 2

Re: How to: Django development and debugging

2016-10-23 Thread Derek
Is VS Code Editor available on Linux platforms? On Friday, 21 October 2016 02:30:45 UTC+2, Don Thilaka Jayamanne wrote: > > Hi Everyone, I'm the author of a Python plugin for the VS Code editor ( > https://github.com/DonJayamanne/pythonVSCode). Basically it provides > intellisense, code navigatio

Re: Read Only by user in Django Admin

2016-10-24 Thread Derek
Would it be possible to add these extra admin methods into a parent class; and then have all your individual model admins inherit from it? Ditto for the models.py On Sunday, 8 February 2015 21:15:42 UTC+2, Hangloser Firestarter wrote: > > Solved. > > In __init__.py > ... > from django.db.models

Re: Newbie question - data structure for game

2016-10-30 Thread Derek
You'll probably need jQuery. Bear in mind "size" is not absolute as it will depend on font family and font height. On Sunday, 30 October 2016 01:27:59 UTC+2, Ken Albright wrote: > > Sounds good. Thanks for the advice. Now if I could only figure out how to > get forms to expand and contract to ma

Re: Admin site - prepopulating field based on foreign key

2016-11-04 Thread Derek
You need a third-party app e.g. https://github.com/digi604/django-smart-selects On Thursday, 3 November 2016 19:21:14 UTC+2, dod...@gmail.com wrote: > > I'm having trouble with my admin site, would appreciate any pointers. > > I have these three models in my database with relationships as shown:

Re: django admin interface

2016-11-18 Thread Derek
Not a direct answer, but its much easier to use the in-built options to extend admin actions: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/actions/ Otherwise you will probably need to extend/override the admin template to add the code&link for your button; e.g. see: http://stackoverf

Re: wsgiref - When does the complexity of question require posting to the Developers or other forums?

2016-12-04 Thread Derek
This may be "off topic" - so feel free to disregard! - but why "blogs on porting from 1.1 to 1.6"? If you are in the process of upgrading, then why not keep going to at least 1.8, which is the oldest version still receiving patches and support? Some blogs are: * https://www.caktusgroup.com/b

Re: Where to store simple texts

2016-12-11 Thread Derek
And in the model, have a field in which you store the text - you can edit this field via something like TinyMCE (https://django-tinymce.readthedocs.io/en/latest/). If it is just a few, fixed pages; you can also use https://docs.djangoproject.com/en/1.10/ref/contrib/flatpages/ On Saturday, 10

Re: existing database connectivity

2016-12-19 Thread Derek
Suggest you look at Django authentication: https://docs.djangoproject.com/en/1.10/topics/auth/customizing/ "Authentication backends provide an extensible system for when a username and password stored with the user model need to be authenticated against a different service than Django’s default.

Override base filter for model's queryset (Django 1.6)?

2017-01-14 Thread Derek
hanks Derek ``` from django.db.models import Model, Manager from django.db.models import AutoField, CharField from django.db.models.query import QuerySet class MyModelQuerySet(QuerySet): # NEED to override the base filter for this model ??? """ def __init__(s

Re: Override base filter for model's queryset (Django 1.6)?

2017-01-15 Thread Derek
17 21:58:15 UTC+2, Melvyn Sopacua wrote: > > On Saturday 14 January 2017 21:20:32 Derek wrote: > > > and I also want to override the base filter for > > > the model's > > > queryset to limit what is displayed. > > > > This is covered in the Manage

Re: Admin problem launching a non-Admin page

2019-01-15 Thread Derek
you to do the same. Maybe you can get some ideas from them? Basically you can create your own view and use that to display data in a template that inherits from, for example, the Django admin form template. A bit tricky first time but then it seems straightforward. Derek On Tuesday, 15 Janua

Re: Retrieve data from database by taking user input data.

2019-02-02 Thread Derek
Using the `render` method or, failing that `redirect`, after the data from the results of your query have been collated. Without actual code , its hard to help you further. On Friday, 1 February 2019 21:05:28 UTC+2, Surajeet Das wrote: > > I have been trying to write a query to retrieve data fro

Re: Webinterface for python script

2019-02-04 Thread Derek
Django could be overkill for his. Try using Flask e.g. https://stackoverflow.com/questions/39321540/how-to-process-an-upload-file-in-flask On Sunday, 3 February 2019 17:53:20 UTC+2, Asad Hasan wrote: > > Hi All , > > I have created certain python scripts to analyze log files and > sug

Re: Webinterface for python script

2019-02-05 Thread Derek
m a spreadsheet and store in a DB, then I would offered advice how to do that with Django. But its a mistake to think that "Python" + "data processing" automatically equals Django. My 2c Derek On Tuesday, 5 February 2019 11:04:45 UTC+2, Eric Pascual wrote: > > Hi, &

Re: REST Framework alternatives

2019-02-07 Thread Derek
I can't speak to the inflexible, but there are a ton of tutorials out there for DRF, and I was able to make a lot of progress in just one weekend. I would think that JSON validation is an orthogonal problem; you can look at using something like https://pypi.org/project/jsonschema/ for this. On

Re: How to display file&folder tree using Django. Help, please!

2019-02-10 Thread Derek
There are a number of custom Django apps that can do something like, for example: https://github.com/IMGIITRoorkee/django-filemanager (or look here https://djangopackages.org/grids/g/file-managers/ for more) On Friday, 8 February 2019 14:24:01 UTC+2, Yura wrote: > > Hello everyone! I really ne

Re: Providing help on a website (basic CMS for on-site site documentation)

2019-03-03 Thread Derek
"Surely it's a ubiquitous need" No, I think not. In the dim and distant past I used to write copious help files for various Windows apps ... but on the web? No one really reads manuals or help files any more - your app needs to be simple and obvious to use. If you are that noble as to still

Re: Django connectivity with MySQL service in docker container

2019-03-03 Thread Derek
The good news is that someone already wrote a series of blog posts for you: * http://www.nisanthsojan.com/django-mysql-with-docker%e2%80%8a-a-step-by-step-guide-for-local-development-part-1/ * http://www.nisanthsojan.com/django-mysql-with-docker%E2%80%8A-a-step-by-step-guide-for-local-developmen

Re: Is there any inline editing the data and delete data in table in Django?

2019-03-03 Thread Derek
Grid / tabular editing outside of the admin is tricky; I have not been able to manage it and have not found a good app for it. Here are some suggested reading: * https://www.ibm.com/developerworks/library/wa-django/index.html * https://bossanova.uk/jexcel * https://medium.com/ag-grid/building-

Re: My developers have run amok

2019-03-03 Thread Derek
Just because something can be done, does not mean it should be done. I have always avoided putting large binary files into the DB - why? Primarily because the information in them is "dead" - very hard to search or filter, which rather defeats the point of using a DB. Rather leave them on disc

Re: Missing manage.py & settings.py

2019-03-03 Thread Derek
Pretty much *all* the apps you use in your Django project will be installed via pip ... On Saturday, 2 March 2019 06:00:47 UTC+2, lujate wrote: > > Interesting. I never thought about doing a pip install of an application. > I'm going to have to digest that one. > > Thanks > -- You received th

Re: How to upload pdf files in django

2019-03-03 Thread Derek
Simple tutorial here: https://simpleisbetterthancomplex.com/tutorial/2016/08/01/how-to-upload-files-with-django.html On Saturday, 2 March 2019 17:12:01 UTC+2, Akshay Gupta wrote: > > and to get back data from form request.POST['file_name'] ?? > > > > Sent from my Redmi 4 > On mazz ahmed >,

Re: Providing help on a website (basic CMS for on-site site documentation)

2019-03-05 Thread Derek
tion. Unfortunately, you seem to be in some less-common "middle ground" where you need both a pile of flat pages and a pile of dynamic pages a chance for creativity on your part! On Monday, 4 March 2019 12:08:36 UTC+2, Bernd Wechner wrote: > > Derek, > > Empirically by e

Re: My developers have run amok

2019-03-07 Thread Derek
ted - but obviously there are sometimes constraints that force our hand to do things in non-optimal ways. You have my sympathies (for what they are worth). On Monday, 4 March 2019 16:30:04 UTC+2, Dan Davis wrote: > > Derek, it all depends on where you are. I'm \at a government agen

Re: linking django app to slurm db

2019-03-08 Thread Derek
I have not worked with SLURM in any way at all ... but it seems to me that if its a third-party app, you'd be better off working with an API that will shield you from the messy details of the internal database e.g. https://github.com/PySlurm/pyslurm On Thursday, 7 March 2019 15:39:24 UTC+2, Bi

Re: Is there any inline editing the data and delete data in table in Django?

2019-03-19 Thread Derek
That is not an answerable question. We have given you suggestions - the "how" is up to you. On Tuesday, 19 March 2019 09:36:27 UTC+2, veera nagaraja sankar Inti wrote: > > > how ? > > On Monday, March 4, 2019 at 12:40:03 PM UTC+5:30, Derek wrote: >> >>

Re: Is there any inline editing the data and delete data in table in Django?

2019-03-20 Thread Derek
the back-end to handle the server side data generation and database updates. Please don't keep asking "how" and rather start with your own development. On Wednesday, 20 March 2019 21:57:21 UTC+2, Chetan Ganji wrote: > > Hi Sankar, > > Derek is right, we can only give yo

Re: Creating Objects from Annotations and Other Models

2019-03-20 Thread Derek
Permanently storing data that can be recalculated from existing data is a practice specific to the needs of particular applications. Have you perhaps considered making use of the "view" table functionality available in most databases? For example, in PostgreSQL you can create a materialized v

Re: Creating Objects from Annotations and Other Models

2019-03-21 Thread Derek
8, Dylan Young > wrote: > >> It's not a recalculation. It's instantiation. >> >> Instance data diverges from the factory data and needs to be >> independently editable. >> >> Best, >> >> Casey >> >> Le jeu. 21 mars 2019 2:52 a.

Re: Upgrading Django from 1.11 to 2.2

2019-04-01 Thread Derek
The upgrade doc has good, general advice but does not specifically address the issue of LTS-to-LTS upgrades; I must admit I am a bit disappointed as I thought that there would be explicit, official support for this migration (and its one of the reasons I have stayed on the older LTS up to now).

Re: Upgrading Django from 1.11 to 2.2

2019-04-02 Thread Derek
I agree; and the reason for Django moving to LTS releases was so that you would be able to upgrade from one LTS to the next. Hence the OP (and others like me I am sure) asking how that can be done - we are looking for specific advice or instructions (and less about "general" guidelines). On Tu

Re: Feedback regarding Django-Suit for Django Admin Panel Customization - Need to add New Menu for Report Generations

2019-04-09 Thread Derek
You'd need to create your own reporting app, with view and templates for creating your reports (plus an entry in urls.py of course) The Django Suit menu could then be updated to link to your report index page: # -*- coding: utf-8 -*- """ Django Suit Configuration Module """ from django.apps im

Re: Is there a way to extend Django Admin to normal user/staff? If so, how?

2019-04-09 Thread Derek
Django admin is perfectly usable by anyone that can be trained to understand it. What is the issue you have? On Tuesday, 9 April 2019 13:29:53 UTC+2, Chaitanya Vankadaru wrote: > > I am looking to extend Django Admin to normal user/staff? If so, how? > > Please reply with your ideas/solutions. >

Re: Is django can run in FIPS mode:

2019-04-11 Thread Derek
Its clear that 28401 is not fixed. I see another project had a similar problem & used a work-around - https://pulp.plan.io/issues/3639 On Wednesday, 10 April 2019 13:12:13 UTC+2, Gowtham Shanmugam wrote: > > Hi All, > I am using graphite-web-1.1.4-1 and python-django-1.11.15. I am facing > so

Re: DB queries in django scripts

2019-04-11 Thread Derek
If you are using PostggeQL you may want to look at the query analysis produced by: https://www.postgresql.org/docs/current/pgstatstatements.html There are various third-party tools to gather output from the pg_stat_statements and make it available e.g. https://github.com/pganalyze/collector http

Re: Changing Admin Interface in Django

2019-04-12 Thread Derek
You can look at projects like: https://github.com/douglasmiranda/django-admin-bootstrap or https://pypi.org/project/django-fluent-dashboard/ or https://github.com/viewflow/django-material for examples of how you might go about doing this. On Thursday, 11 April 2019 18:58:30 UTC+2, Aayush Bhattar

Re: DB queries in django scripts

2019-04-16 Thread Derek
/productssolutions/freetools/monitor-mysql-queries On Monday, 15 April 2019 16:17:02 UTC+2, Web Architect wrote: > > Hi Derek, > > Thanks for your response. We are using MySQL. Could you suggest something > similar for the same? > > Thanks. > > On Thursday, April 11, 2019 at

Re: How to override default Django Admin Panel Model display to Customization

2019-04-16 Thread Derek
Proxy models, with an associated Manager, are one way to achieve this - assuming your criteria are fixed. On Monday, 15 April 2019 15:25:49 UTC+2, Balaji Shetty wrote: > > Hi > > When i do login using Django Admin Panel , i can easily perform CRUD > operation on Models. > > can i customize the

Re: compute model field by related field

2019-04-17 Thread Derek
1. Add a "winner" field to your Match 2. Implement a post_save signal for the Match model that updates the "won" or "lost" fields for each Club in the match (simple if/then logic based on winner). PS I think the default values for "won" and "lost" for a Club should be "0" and not "1". On Tues

Re: compute model field by related field

2019-04-20 Thread Derek
That should just require a basic if/then logic test; "get" the correct Club object, update the win/loss field and save the Club. Repeat for both Clubs. On Thursday, 18 April 2019 14:09:41 UTC+2, omar ahmed wrote: > > thank you for response , derek > but how can i increment &#

Re: I'm going to ask you an editor in django.

2019-04-20 Thread Derek
You are better off integrating with a third-party app e.g. https://wopi.readthedocs.io/en/latest/overview.html On Thursday, 18 April 2019 17:17:19 UTC+2, bang wrote: > > I would like to add editor function in django > and call up stored document( word, pdf, excel), edit and save. Is > there

Re: compute model field by related field

2019-04-23 Thread Derek
date objects (( how can i use post_save here > )) > > On Saturday, April 20, 2019 at 9:09:01 AM UTC+2, Derek wrote: >> >> That should just require a basic if/then logic test; "get" the correct >> Club object, update the win/loss field and save the Club. R

Re: compute model field by related field

2019-04-23 Thread Derek
nstance.club_visitor.won + 1 > else: > return instance.club_local.draw + 1 and instance.club_visitor.draw + 1 > > > On Tuesday, April 23, 2019 at 3:27:28 PM UTC+2, Derek wrote: >> >> You need to use Django signals to provide a custom "post_save". There is >> a

Re: Accessing single value from multiple values from databse

2019-05-02 Thread Derek
The logic would be something along these lines (note that you'd need to sort out the "button click" side) # class Car(models.Model): # two_wheeler = models.CharField(validators=[validate_comma_separated_integer_list]) import random car = Car.objects.get(pk=1) numbers = car.two_wheeler.split

Re: KeyError at /admin/newapp/profile/add/ and Search Error --- Related Field got invalid lookup: icontains

2019-05-27 Thread Derek
Your first error refers to a ProfileForm; you need to post the form definition code here as well. On Sunday, 26 May 2019 20:48:09 UTC+2, Balaji wrote: > > Hi > > Here i want to exclude some model filed depending upon type of User. > > Example if username is "dgp", i want to exclude > in admin.py

Re: list_filter no longer does Boolean?

2019-06-07 Thread Derek
The Django docs describe how to create custom list_filter options via your own classes: https://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter On Thursday, 6 June 2019 08:40:23 UTC+2, Lachlan Musicman wrote: > > > On Thu, 6 Jun 2019 at 16:36, Lachla

Re: Disable count admin

2019-06-08 Thread Derek
Can you use: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.show_full_result_count On Monday, 3 June 2019 14:48:23 UTC+2, Michele Gatti wrote: > > Hi i need to disable paginato on django admin with not managed model. > Is possible? > -- You received th

Re: search bar

2019-06-11 Thread Derek
Here is good place to get started: https://wsvincent.com/django-search/ You can then expand what has been shown here by adding extra UI-side functions such as drop-down fields that will allow a user to refine what is being searched for. (Maybe you can even write your own tutorial after you hav

Re: Internal Server Error: /tinymce/compressor/

2019-06-19 Thread Derek
This is where a tool like Docker is really useful; you can easily test a change like this in a completely clean environment - and quickly see if the problem is the new library version or actually just an issue with your machine setup. On Wednesday, 19 June 2019 05:33:03 UTC+2, Mike Dewhirst wr

Re: Nested dictionaries

2019-07-01 Thread Derek
I am not sure I understand what you mean by " write the models to work with the serializers". A model is there primarily for data storage and its possible to store JSON in a field of such a model. Any "business logic" for the model is just Python and can carry out, for example, processing ope

Re: access league by league-code REST api

2019-07-07 Thread Derek
Have you tried without the {'code'} As per their example: [image: api1.png] On Thursday, 4 July 2019 23:42:05 UTC+2, omar ahmed wrote: > > hiii .. > i use REST api to get data from "https://www.football-data.org"; .. > i want to create one view that can restore any league (by league code > lik

Re: Django admin application for Android

2019-07-16 Thread Derek
Can you explain more about the GOLD plan - what is it and how much does it cost? On Monday, 15 July 2019 12:51:58 UTC+2, Jens-Joris Decorte wrote: > > Hello Django developers! > > Being both a Django developer and a heavy user of Django applications, I > found myself accessing the admin interfac

Re: UniqueConstraint raises uncaught IntegrityError in Admin

2019-07-16 Thread Derek
Would it be correct to say that adding validation at model clean level would make more sense when using this feature with the admin? On Tuesday, 9 April 2019 15:13:19 UTC+2, Simon Charette wrote: > > No form validation is implemented for UniqueConstraint(condition) yet as > that would require >

Adding line-level profiling to Django admin functions?

2017-01-28 Thread Derek
of Django. If there is a simple plug-in or app that can handle this, I'd appreciate being pointed to it; otherwise, if there is some known way of getting at this information it would be very helpful to hear about it. Thanks Derek -- You received this message because you are subscribed t

Re: Read status in admin section

2017-02-06 Thread Derek
You probably need to create an admin action; the administrator can click on the items they want to mark as "read" and then select your custom action. Docs: https://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/ Plenty of examples in blogs ... On Monday, 6 February 2017 14:24:49 UTC+2,

<    1   2   3   4   5   6   7   8   9   10   >