Re: Django, JavaScript, Python, HTML : Print on html a variable running on python file

2015-04-20 Thread Marc Patermann
Beatrice, Beatrice Galvani schrieb (16.04.2015 17:34 Uhr): Hi, I'm using Django 1.7.2, Python 3.4. My trouble is: I have a simple function in some directory written in python (e.g. a counter since 0 to 10); I would like to see these numbers on my monitor on the HTML page.. I know how start

JSON to relational database

2015-04-20 Thread ankit . rana
Hi everyone, i had one json data like this to table say "data" { id:##, name:{fname:##,lname:##}, class:##, age:##, courses:[###,###,###,###] } How to map this json data to a relational database?? i understand that only two things are possible :make fname and lname as a column of data table or

Serialize QuerySet Q (not the result)

2015-04-20 Thread guettli
We want to store the QuerySet query (not the result) some how. Background: users should be able to save a complex query as "my favorite query". Pickling querysets is possible, but version updates are not supported:

Re: Django Performance

2015-04-20 Thread jogaserbia
You might want to start by posting what you have learned so far (with some effort shown). Otherwise, you are asking people to complete your homework for you. Otherwise, post most specific questions for clarification. On Saturday, April 18, 2015 at 8:52:13 AM UTC-4, Jasvir Singh wrote: > > Hi

Cannot delete with overridden ModelAdmin.save_formset()

2015-04-20 Thread Carsten Fuchs
Dear Django fellows, I use a ModelAdmin.save_formset() method exactly like in the Django Admin documentation: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset This is the exact code: def save_formset(self, request, form, formset,

Re: Testing request parameters in Django (“+” behaves differently)

2015-04-20 Thread Tom Evans
On Sat, Apr 18, 2015 at 12:13 PM, Eneko Illarramendi wrote: > Previously posted in SO: > http://stackoverflow.com/questions/29703930/testing-request-parameters-in-django-behaves-differently > --- > > I have a Django View that uses a query

Re: Testing request parameters in Django (“+” behaves differently)

2015-04-20 Thread Eneko Illarramendi
Thank you Tom. Somehow it seemed strange to test this view using client.get('/page/', { 'filter': 'one and two'}) but I get why it is like this. Cheers, Eneko On Monday, April 20, 2015 at 3:30:55 PM UTC+2, Tom Evans wrote: > > On Sat, Apr 18, 2015 at 12:13 PM, Eneko Illarramendi >

Re: Cannot delete with overridden ModelAdmin.save_formset()

2015-04-20 Thread Carsten Fuchs
Hi all, Am 20.04.2015 um 15:29 schrieb Carsten Fuchs: I use a ModelAdmin.save_formset() method exactly like in the Django Admin documentation: https://docs.djangoproject.com/en/1.8/ref/contrib/admin/#django.contrib.admin.ModelAdmin.save_formset [...] The problem is, if I check the "delete?"

Question about run bash scripts on Django-Python

2015-04-20 Thread David Pineda
Hello I'm a begginner in django and i need to work with a form (send a file) and when the file it's ok run a bash scripts to process that. I investigate and the common recomendation si use 'subprocess' an 'sys' So, i can set the path with de bash app, but the system only recognize the 'echo'

Re: Question about run bash scripts on Django-Python

2015-04-20 Thread Larry Martell
On Mon, Apr 20, 2015 at 10:31 AM, David Pineda wrote: > Hello > I'm a begginner in django and i need to work with a form (send a file) and > when the file it's ok run a bash scripts to process that. > > I investigate and the common recomendation si use 'subprocess' an 'sys' >

Re: Serialize QuerySet Q (not the result)

2015-04-20 Thread Vijay Khemlani
Are the queries associated with a certain form? Or they are arbitrary queries? On Mon, Apr 20, 2015 at 10:01 AM, guettli wrote: > We want to store the QuerySet query (not the result) some how. > > Background: users should be able to save a complex query as "my favorite >

Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread SHINTO PETER
how to limit memory utilization for a particular python script ? -- 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+unsubscr...@googlegroups.com. To

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread François Schiettecatte
You don’t say what platform you are running on, but on linux/unix you can use ulimit, see http://ss64.com/bash/ulimit.html François > On Apr 20, 2015, at 1:09 PM, SHINTO PETER wrote: > > how to limit memory utilization for a particular python script ? > > -- > You

Choices in DecimalField - django 1.8.

2015-04-20 Thread Elton Pereira
In the model below, using the Django admin, no matter what value I choose, it always displays the default value. But writes the correct value in the database. Am I doing something wrong or is this a bug? TENSAO_220 = Decimal(220) TENSAO_110 = Decimal(110) TENSOES = ((TENSAO_220, '220 volts'),

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Tim Chase
On 2015-04-20 13:13, François Schiettecatte wrote: > You don’t say what platform you are running on, but on linux/unix > you can use ulimit, see http://ss64.com/bash/ulimit.html I've wanted this occasionally, but "ulimit -m" doesn't appear to work on most modern Linux installations. See

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread SHINTO PETER
Working with linux/unix On Monday, 20 April 2015 22:44:17 UTC+5:30, François Schiettecatte wrote: > > You don’t say what platform you are running on, but on linux/unix you can > use ulimit, see http://ss64.com/bash/ulimit.html > > François > > > On Apr 20, 2015, at 1:09 PM, SHINTO PETER

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread François Schiettecatte
Bummer, shows how long it has been since I have used that. Peter, why do you want to limit memory and CPU usage? To prevent someone from killing the machine ? F. > On Apr 20, 2015, at 1:47 PM, Tim Chase wrote: > > On 2015-04-20 13:13, François Schiettecatte

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Tim Chase
On 2015-04-20 13:54, François Schiettecatte wrote: > Peter, why do you want to limit memory and CPU usage? To prevent > someone from killing the machine ? I know I've wanted it to help prevent malicious data that could suck up my RAM and push things into swap. Absent "ulimit -a", I've had to

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread François Schiettecatte
I did a little research on this and found cpulimit, you can also use nice and renice, and (on fedora core 21 at least) you can do 'cat /proc/###/status’ where ### is the process ID which will give you memory stats on a process. Not ideal but you can wrap all of these in some python to make it

moving from Django 1.6 and south to Django 1.8 -- auth migrations not applied

2015-04-20 Thread Scott Hostovich
I moving from Django 1.6 and south to Django 1.8. I followed the instructions at https://docs.djangoproject.com/en/1.8/topics/migrations/#upgrading-from-south and things seemed to work fine. Then I noticed that the auth migrations did not get applied to the database

upgrading from Django 1.6 and south to Django 1.8

2015-04-20 Thread Scott Hostovich
I'm upgrading from Django 1.6 and south to Django 1.8. Following the instructions at: https://docs.djangoproject.com/en/1.8/topics/migrations/#upgrading-from-south seems to work initially but then realize that the user model wasn't updated:

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Tim Chase
On 2015-04-20 16:01, François Schiettecatte wrote: > I did a little research on this and found cpulimit, you can also > use nice and renice, Yes, nice/renice and their I/O friend ionice (in my Debian installation, it's part of the "util-linux" package) work quite nicely. It's the memory-limiting

Re: Putting Limits on Memory and CPU Usage in python ?

2015-04-20 Thread Erik Cederstrand
> Den 20/04/2015 kl. 19.46 skrev SHINTO PETER : > > Working with linux/unix If unix includes FreeBSD, check out https://www.freebsd.org/doc/en/books/handbook/security-resourcelimits.html Erik -- You received this message because you are subscribed to the Google Groups

Choices as a callable.. but no parameters?

2015-04-20 Thread Steve Hiemstra
I am trying to build a form with dynamic choices. e.g., the choices should depend on the user. https://docs.djangoproject.com/en/1.8/ref/forms/fields/#choicefield Says choices may now be a callable, and sure enough it is called in ` django/forms/fields.py(818)` – but without any parameters.

Re: Choices as a callable.. but no parameters?

2015-04-20 Thread Vijay Khemlani
Overwrite the constructor of the form (__init__), pass the user or whatever parameters you may need and overwrite the choices of the field in the body of the method. On Mon, Apr 20, 2015 at 10:56 PM, Steve Hiemstra wrote: > I am trying to build a form with dynamic choices.

Re: Choices as a callable.. but no parameters?

2015-04-20 Thread Stephen J. Butler
On Mon, Apr 20, 2015 at 9:45 PM, Vijay Khemlani wrote: > Overwrite the constructor of the form (__init__), pass the user or whatever > parameters you may need and overwrite the choices of the field in the body > of the method. This is the same strategy I've used to filter