Re: Math filter

2017-07-18 Thread James Schneider
On Jul 18, 2017 7:21 PM, "sum abiut" wrote: Hi, needed direction maths filters on django templates. for example how to you perform this on a template. a*b +b*c i did a|mul:b|add:b|mul:cbut got a wrong answer. Please point me to right direction. I wouldn't do any

Math filter

2017-07-18 Thread sum abiut
Hi, needed direction maths filters on django templates. for example how to you perform this on a template. a*b +b*c i did a|mul:b|add:b|mul:cbut got a wrong answer. Please point me to right direction. cheers, -- You received this message because you are subscribed to the Google

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
I'm not trying to update database 5.1 to 5.7. I am simplying seeing difference in terms of performance when running against different version of Mysql with same dataset. Can you please explain how dumpdata could help? On Tuesday, July 18, 2017 at 12:46:43 PM UTC-7, sacrac wrote: > > why you

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
Yes, my local database is actually a mysqldump of the production so in terms of data set, it's the same On Jul 18, 2017 12:13 PM, "Felipe Brunelli de Andrade" < fbruandr...@gmail.com> wrote: It seems like some thing in your app view. Did you try to dump real database and run localy in your

Re: Using Static files

2017-07-18 Thread yingi keme
Antonis, i think i understand the logic now. Thanks for the help. Yingi Kem > On 18 Jul 2017, at 3:25 PM, Antonis Christofides > wrote: > > Hi, > > Define staticUrl in the base template, like this: > > > staticUrl = "{% static '' %}"; > > > > Then, inside

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread carlos
why you try update the databases 5.1 to 5.7? try dumpdate with manage.py django in .json all apps y then loaddata in new database! https://docs.djangoproject.com/en/1.11/ref/django-admin/#dumpdata cheers On Tue, Jul 18, 2017 at 1:12 PM, Felipe Brunelli de Andrade < fbruandr...@gmail.com>

Re: Using Static files

2017-07-18 Thread yingi keme
When i opened the console in my browser. It shows the error 'staticUrl is not defined'. The problem i am having is this. You are making use of a static file (blank.gif) inside another static file (d6.js) Do you have to load static files inside the d6.js much thesame way you load static files

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Felipe Brunelli de Andrade
It seems like some thing in your app view. Did you try to dump real database and run localy in your workstation? 2017-07-18 16:05 GMT-03:00 Kevin Yu : > >

Re: Using Static files

2017-07-18 Thread yingi keme
Okk The static url you defined in the script. Isnt it supposed to be: var staticUrl = "{% static %}"; I am thinking there is an error with the quotation mark u used. Am i correct? Yingi Kem > On 18 Jul 2017, at 3:25 PM, Antonis Christofides > wrote: > > Hi,

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
I even noticed when i do runserver on my local to connect to the older version of mysql db, the starting of dev server is

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Felipe Brunelli de Andrade
Try to debug in chrome just press F12 and go to network tab and see the times fot load content 2017-07-18 15:18 GMT-03:00 Kevin Yu : > I've eliminated the possibility of mysql performance issue by directly > running the query on the database. It's not network issue

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
I've eliminated the possibility of mysql performance issue by directly running the query on the database. It's not network issue either since my ping is just fine. On Tuesday, July 18, 2017 at 11:00:58 AM UTC-7, Kevin Yu wrote: > > Hi All, > > I'm rewritting an web application using Django

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
Hi Felipe, Thanks for the quick response. I've eliminated it's cpu load on the production server by directing running the query on the mysql and calculation time is very quick. It's unlikely network issue because the ping is pretty quick. mysql query time on the server: 1063 rows in set (0.00

Re: Would old version of mysql caused performance issue in Django

2017-07-18 Thread Felipe Brunelli de Andrade
You need to see de CPU load in server. In your test you probably are using a local machine with no loading... but your produce server I dont know. You need to see in server the webserver too, try to run django-admin runserver :8000 and see if you have the same issue. But if you are just

Would old version of mysql caused performance issue in Django

2017-07-18 Thread Kevin Yu
Hi All, I'm rewritting an web application using Django 1.11. When i hooked up to my test mysql database (version 5.7), the performance is amazing. The page renders within 1 second. However, when I connect to the existing production mysql (version 5.1), the page takes more than 10 seconds.

Re: Multiple DB - Accessing another app's table/model?

2017-07-18 Thread Avraham Serour
import the Model and query it. from appB.models import Table Table.objects.all() On Tue, Jul 18, 2017 at 6:01 PM, miguel vfx wrote: > Hello, > > After following through the documentation, I was able to query data from > another database. However, I was only able to access

Re: Create Mobile App from Django Template

2017-07-18 Thread carlos
Hi, but is he need stored information offline, the app save data (local stored) and then synchronize with the databases in django (web databases) How can you do something like that? On Mon, Jul 17, 2017 at 1:55 PM, Marsel Xhaxho wrote: > Hello, > > Django Rest Framework

Re: Migration for auth_user.username field

2017-07-18 Thread Markus Holtermann
Hi Graeme, the only solution that comes to mind is overriding the alter_field() or _alter_field() methods on the schema editor: https://github.com/django/django/blob/stable/1.11.x/django/db/backends/base/schema.py /Markus On Wednesday, July 19, 2017 at 12:19:09 AM UTC+10, Graeme Perrow wrote:

Multiple DB - Accessing another app's table/model?

2017-07-18 Thread miguel vfx
Hello, After following through the documentation, I was able to query data from another database. However, I was only able to access the table of the same app name. How can I query data from a different app name? For example: appA has a model client_data. It's table name in the app_db database

Blog Post using Django

2017-07-18 Thread Development ManyThing
Hello Everyone, I'm new to this community and also new to Django Framework. I've been working on creating a blog for practice purpose to improve my skills and learn more and more about the Framework but I'm stuck. It's a normal blog where the post gets displayed and we add a post from the admin

Re: How to get extra data in clean_data?

2017-07-18 Thread 'Tom Evans' via Django users
On Tue, Jul 18, 2017 at 2:13 PM, 李余通 wrote: > Thank you very much!you are right > I solve the problem: > [...] > And last,I want konw how to send a web pag (can auto jumps Specific > location) to others,such as you url >

Re: Using Static files

2017-07-18 Thread Antonis Christofides
Hi, Define staticUrl in the base template, like this: staticUrl = "{% static '' %}"; Then, inside d6.js: var imageBank = staticUrl + 'Game/blank.gif'; (It is also good practice to use a single JavaScript global variable, like app.staticUrl, in order to not pollute the global namespace,

Migration for auth_user.username field

2017-07-18 Thread Graeme Perrow
I am responsible for the SQL Anywhere Django driver and I'm trying to add support for Django 1.10. When I create a project and run "python manage.py migrate", it executes a bunch of SQL statements but then fails when altering the auth_user table

Re: What Way is best to extend User in Django 1.11?

2017-07-18 Thread James Bennett
If the fields you're adding are things that you need to know for purposes of figuring out who someone is and what they're allowed to do, put them in a custom User model. If the fields you're adding are not for the purpose of figuring out who someone is and what they're allowed to do, put them in

Using Static files

2017-07-18 Thread yingi keme
I have a javascript file in my app static directory. However inside my javascript file. I want to make use of an image. That is: Javascript file is d6.js and it contains this code var imageBank = baseUrl + "static/Game/blank.gif"; And then my html has this {% load staticfiles %} However

Re: What Way is best to extend User in Django 1.11?

2017-07-18 Thread Avraham Serour
I suggest creating a profile, leave the auth.User only for auth, all else specific to you application use your own model and reference to that On Tue, Jul 18, 2017 at 9:48 AM, 李余通 wrote: > How to extend User?I find many ways; > 1. Use Profile > eg: > > class

Re: How to get extra data in clean_data?

2017-07-18 Thread 李余通
Thank you very much!you are right I solve the problem: and I find another way to sovel: use claea() def clean(self): cleaned_data = super(Register,self).clean() passwd = cleaned_data.get('passwd') repasswd = cleaned_data.get('repasswd') if(passwd != repasswd):

Re: How to get extra data in clean_data?

2017-07-18 Thread 李余通
Thanks very much! So now hava two way to solve problems; one is clean() def clean(self): cleaned_data = super(Register,self).clean() passwd = cleaned_data.get('passwd') repasswd = cleaned_data.get('repasswd') if(passwd != repasswd): self.add_error('repasswd',u'两次密码不一致')

Re: How to get extra data in clean_data?

2017-07-18 Thread Jani Tiainen
You can see how Django itself validates the password: https://github.com/django/django/blob/master/django/contrib/auth/forms.py#L64 On 18.07.2017 12:51, 'Tom Evans' via Django users wrote: As described in the docs on form and field validation, if you want to validate one field using another

Re: How to get extra data in clean_data?

2017-07-18 Thread 'Tom Evans' via Django users
As described in the docs on form and field validation, if you want to validate one field using another field, you do so in the clean() method: https://docs.djangoproject.com/en/1.8/ref/forms/validation/ and in detail

How to get extra data in clean_data?

2017-07-18 Thread 李余通
My mind is here: class Register(forms.Form): passwd = forms.CharField(max_length=20,label='密码',widget=forms.PasswordInput) repasswd = forms.CharField(max_length=20,label='重复密码',widget=forms.PasswordInput) def clean_passwd(self): passwd = self.cleaned_data['passwd'] repasswd =

What Way is best to extend User in Django 1.11?

2017-07-18 Thread 李余通
How to extend User?I find many ways; 1. Use Profile eg: class UserProfile(models.Model): user = models.OneToOneField(User) major = models.TextField(default='', blank=True) This way is easy to understand,However,it will create a new table in sql,I heard this will add System burden.