Re: Where is all the time going?

2017-05-23 Thread Bernd Wechner
James, Thanks for the quick look, the tips and more. I am using Django 1.11 and given your notes a huge suspect because: 1. This slow down is very recent 2. very recently I upgraded to 1.11 specifically because I needed a subquery on one view Rolling back to 1.10 is an option for testing,

Re: Where is all the time going?

2017-05-23 Thread James Schneider
On Mon, May 22, 2017 at 10:12 PM, Bernd Wechner wrote: > James, > > If you have the fortitude and kind heart to look at it, sure the code base > (just checked in) is here: > > https://github.com/bernd-wechner/CoGs > > > That's quite a code repo. Bravo. I did poke

saving data from both a model and a derived model

2017-05-23 Thread jjanderson52000
I have a model class, 'A_base', and a 2nd model class, 'A_derived'. When I save an object of A_derived, I want the data from both my base and derived class to be saved. Example code looks like this: class A_base(models.model): name = models.CharField(max_length=50) class

websocketbridge.js:183 Uncaught DOMException: Failed to execute 'send' on 'WebSocket': Still in CONNECTING state.

2017-05-23 Thread djangorobert
Hi Im working with django and django channels but seem to be running in to constant road blocks not able to get a websocket conection i working with andrew godwins example on github the "MULTICHAT" example all im trying to do is to get it to work lol in a production envirment but i continue to

Re: best practices for handling charts

2017-05-23 Thread Fred Stluka
Alceu, I agree that a client side API makes sense in this case.  Solves the whole question of temp files.  You may want to look into the Google Chart API.  It's a REST service, where you pass the data to be graphed, the style of graph desired (line, bar, pie,

Re: best practices for handling charts

2017-05-23 Thread Alceu Rodrigues de Freitas Junior
Thanks for answering James, I commented your e-mail below: Em 23/05/2017 12:06, James Schneider escreveu: On May 23, 2017 6:33 AM, "Alceu Rodrigues de Freitas Junior" > wrote: Hello to all, I have some charts created

Re: best practices for handling charts

2017-05-23 Thread James Schneider
On May 23, 2017 6:33 AM, "Alceu Rodrigues de Freitas Junior" < alceu.freitas...@gmail.com> wrote: Hello to all, I have some charts created with matplotlib and I would like to include them in my Django application. What is the considered best practices in order to do that? I'm considering

Re: Aggregation question

2017-05-23 Thread 刘是
I have submitted a ticket: https://code.djangoproject.com/ticket/28233 在 2017年2月9日星期四 UTC+8上午7:24:24,Tim Graham写道: > > Please submit a pull request to fix the documentation if you can. > > There's an open ticket for a way to get the SQL for a terminal queryset > method:

RE: append language-code tot variable name

2017-05-23 Thread Matthew Pava
Have you considered internationalization and localization as an alternative to what you are doing? https://docs.djangoproject.com/en/1.11/topics/i18n/ To do what you are doing, you would need to do it in the view function, something like this: context[‘title’] = getattr(artobject, “%s_%s” %

Re: Aggregation question

2017-05-23 Thread 刘是
Hi, have you submitted an issue or pull request for that? If not, I can help with that. 在 2017年2月9日星期四 UTC+8上午6:09:25,Viktor Bale写道: > > Ok, you spurred me on to actually try it out. And the answer is > interpretation (i) is correct. Which means the example in the cheat sheet > is somewhat

append language-code tot variable name

2017-05-23 Thread Jaap van Wingerde
In my templates I have variables as {{ artobject.title|safe|capfirst }}. I want the site in more languages.So in changed the model: title changed in title_nl, and I appended title_de, title_en, title_fr. This is more easy for me than po-files. A template must work for all languages,so the

Re: Updating 1.10 to 1.11.1 and AttributeError

2017-05-23 Thread Simon Charette
Hello, Could you please share all of your INSTALLED_APPS? Are you using any kind of query caching? Thanks, Simon Le mardi 23 mai 2017 08:52:56 UTC-4, Jorge Cadena a écrit : > > Hi > > using: django.db.backends.postgresql_psycopg2 > > DATABASE_ROUTERS = ['app.general.router.DatabaseAppsRouter']

best practices for handling charts

2017-05-23 Thread Alceu Rodrigues de Freitas Junior
Hello to all, I have some charts created with matplotlib and I would like to include them in my Django application. What is the considered best practices in order to do that? I'm considering processing the data and generating PNG files in "temporary" locations, so I when the chart file is

Re: Where is all the time going?

2017-05-23 Thread Bernd Wechner
Tom, Had a similar thought and while it does have a few drop downs with tens of entries (because the dataset is only nascent and small) I: 1. Am rather aghast if tens of entries in a few drop downs generate 20s page load times so didn't think it a prime suspect. 2. Have the intention of

Re: tutorial on using dbshell?

2017-05-23 Thread Jim Anderson
James, Thank you, again. I have install the sqlite command line package and all is working for me. Jim A. On Mon, May 22, 2017 at 6:35 PM, James Schneider wrote: > > > On May 22, 2017 3:07 PM, "Jim Anderson" wrote: > > Hi James, > > I'm

Re: Updating 1.10 to 1.11.1 and AttributeError

2017-05-23 Thread Jorge Cadena
Hi using: django.db.backends.postgresql_psycopg2 DATABASE_ROUTERS = ['app.general.router.DatabaseAppsRouter'] router.py > """Router control all database operations on models for different > dababases. > > .. versionadded:: 3.0 > > """ > from django.conf import settings > > > class

Most efficient and scalable search strategy

2017-05-23 Thread Mike Dewhirst
Django 1.10, Postgres 9.1 (for the moment), Python 2.7 (for the moment) on Ubuntu 16.04 The search I need is an intersection hit. We have a substance model with fields for ... - name - molecular formula with subscripted unicode numbers - CAS number plus a Synonym model in 1:n with substance

Re: testing in django

2017-05-23 Thread Antonis Christofides
Hi, one possibility is this: class UserTest(TestCase): def setUp(self): self.my_data = {...} def test_create_account(self): response = self.client.post('/signup/', json.dumps(self.my_data), content_type='application/json')

Re: testing in django

2017-05-23 Thread Александр Христюхин (roboslone)
Perhaps fixtures is what you want: https://code.djangoproject.com/wiki/Fixtures > On 23 May 2017, at 10:07, Akash Tomar wrote: > > class SignUpTest(TestCase): > def test_createAccount(self): > my_data

testing in django

2017-05-23 Thread Akash Tomar
class SignUpTest(TestCase): def test_createAccount(self): my_data = {'username': 'akash.tomar107', 'password': 'akashtomar',"email":"akash.tomar...@gmail.com", "confirm_password":"akashtomar", "type_of_user":"1", "first_name":"akash", "last_name":"tomar"} response = self.client.post('/signup/',