Not talking about the delay method.
I want to be able to get a task, given it's task_id and change it's ETA on the fly, before it is executed.
For now I have to cancel it, and re-schedule one. Troublesome if the scheduled process involve a lot of stuff.
...
For now I get a task_id from the async_result and have to save it the get it back later.
Would be better if I knew what the task_id what made of so I can calculate it back instead of pulling from the DB. E.G: set a task with task_id=("%s-%s" % (user_id, datetime)).
...
Sometimes it makes sense to cluster related data together. I tend to do so with a dict, e.g.,
self.group = dict(a=1, b=2, c=3)
print self.group[a]
One of my colleagues prefers to create a class
class groupClass(object):
def __init__(a, b, c):
self.a = a
self.b = b
self.c = c
self.group = groupClass(1, 2, ...
Hi,
I'm sorry if I wasn't clear enough in the title, don't hesitate to correct it if you find a better way to express that:
I have a file where there are class names, i.e.:
classa
classb
classb
classc
classc
classc
Then I want to read it line by line and to dynamically create that class.
I would do something like that in php:
while...
In my localhost Django administrator I am able to fill-in Date and Time fields by clicking on the little "Date" and "Time" helper icons next to my pub_date field. However, the same administrator on my Server does NOT show these icons. The server-side admin also doesn't pop open a pop-up window for the little "+" plus sign for fields in r...
I have this class in one file and item class in another file in the same module. If they are in different modules or files when I define a new Channel, I got an error because Item is not in the same file. How can I solve this problem? If both classes are in the same file, I don't get any error.
ChannelTest.py
from ItemTest import Item
...
Would it be considered bad practice to use a widgets title attribute to refer it?
For example I have a number of custom radioBoxCtrls on a panel
I only ever need to get/set all the values at once
so the container class(a panel) for the radioBoxCtrls objects has the following methods
get_options()
set_options()
To set options for...
I assigned values with setattr() function in a loop:
for i in range(30):
for j in range(6):
setattr(self, "e"+str(i)+str(j), Entry(self.top))
, then I want to apply .grid() func. to all these variables with a loop.
For example,
self.e00.grid(row= 0, column= 0)
How can I do that?
...
There is code and Tracebeck. What I'm doing wrong?
media=MediaObject.objects.get(
Q(on_air__range=(strt_time,end_time)),
Q(channel=3),
Q(name__icontains="qwwwwwww".decode('utf-8')|Q(name__icontains="cccccccc dddddd".decode('utf-8')))
)
Traceback (most recent call last):
File "C:\Documents and Settings\POLINOM\web\...
Which is more efficient? What is the typical use of each?
...
I'm using a web service backend to provide authentication to Django, and the get_user method must retain a cookie provided by the web service in order to associate with a session. Right now, I make my remote calls just by calling urllib2.urlopen(myTargetService) but this doesn't pass the cookie for the current session along.
I have crea...
I'm developing a django app using aquamacs as my ide. Pdb isn't working since upgrading to emacs 23.2.1 using python 2.6.1. When I invoke pdb like this:
M-x pdb
Run pdb (like this): pdb ./manage.py runserver
The gud-manage.py frame appears with this message (and nothing more) -
Current directory is /path/to/my/source/
It isn't resp...
What are the Pro's and Con's of using win32api for I/O and other things instead of simply Python, if both have a specific function for it
I mean, using PyWin32 vs Win32Api
...
i am using the python shell to try to do debugging
i set a breakpoint
i did:
>>> import pdb
>>> import mymodule
>>> pdb.run('mymodule.test()')
but it is just running my program without stopping at the breakpoint!
what am i donig wrong?
...
i am getting stuck on this line:
row[1].upper().find('CELEBREX',1) (this is returning -1)
it seems to not find CELEBREX even though it is there
row[1] = 'celebrex, TRAMADOL'
am i casting to UPPER incorrectly?
...
I'm using teamplayer, which lets you connect more mice to your computer to be used simultaneously. I'm also using pyHook to capture mouse events, with the following code:
import pyHook
import pythoncom
def onclick(event):
# called when mouse events are received
print 'MessageName:',event.MessageName
print 'Message:',event.Message...
Hi,
I'm using Google App Engine and I need to put a multiline string in the datastore. Unfortunately, GAE does not allow that. I need this string to be multiline, so is there any way to convert a multiline string to a single line string and store it?
...
I'd like to do an XSL transform on a DocBook document using lxml.etree.XSLT.
Although the documentation mentions that etree.XSLT() takes a first parameter of xslt_input, I can't seem to find any docs on what this parameter is meant to be. Passing it a file that is open for reading seems to work; passing it a filename in a string does n...
I am wondering how to create forgiving dictionary (one that returns a default value if a KeyError is raised).
In the following code example I would get a KeyError; for example
a = {'one':1,'two':2}
print a['three']
In order not to get one I would 1. Have to catch the exeption or use get.
I would like to not to have to do that with m...
Hello,
We need to bulk load many long strings (>4000 Bytes, but <10,000 Bytes) using cx_Oracle. The data type in the table is CLOB. We will need to load >100 million of these strings. Doing this one by one would suck. Doing it in a bulk fashion, ie using cursor.arrayvar() would be ideal. However, CLOB does not support arrays. BLOB, LOB,...