-1598932/Atomic-Increment-Counter-Django
Thanks JeeyoungKim for pointing to the right direction.
On 11月23日, 午後5:52, Iqbal Abdullah wrote:
> Since we only run the application on a single server we're using file
> based locking; fail_to_get_lock() and release_lock() tries to create a
> file
e
> F() object and update() methods to update the database.
>
> I have an example, here
>
> http://pastebin.com/qp4ExWC2
>
> On Nov 19, 4:30 pm, Iqbal Abdullah wrote:
>
> > Hi Steve,
>
> > Ops, yes, I forgot to include the object.save() in the pseudo code
> &g
t the object so we can
have the latest state
6 object.value = object.value - 1
7 object.save()
8 print object.value# returns 4
9 object.release_lock()
On 11月20日, 午前7:39, Steve Holden wrote:
> On 11/19/2010 5:35 PM, Iqbal Abdullah wrote:
>
> > Hi,
>
> > This might be a
Hi,
This might be a gotcha on the models side, but I would like
clarification and guidance on how to write the code better concerning
multiple process accessing the same data via models.
I have a backend script that runs the following code in multiple
processes:
1 object = MyModel.object.get(id=
Hi guys,
I have a quick question:
I have set auto_now=True for one of my DateTimeFields.
Lets say I have a model object like so:
>> a = MyModel.objects.get(id="10")
>> print a.id
>> "10"
>> a.id = "10"
>> a.save()
will this cause my DateTimeField to change it's timestamp?
--~--~-~--~-
Hi guys,
I'm trying to figure out if what is going on with the pages i'm
building and how to fix it.
I have an object of User which I put into the sessions:
class User:
def _get_points(self):
return UserModel.point.current_value
def _set_points(self, value):
pass
points = property
est object not being passed around for
context processing.
On May 13, 12:12 am, George Song wrote:
> On 5/12/2009 5:45 AM, Iqbal Abdullah wrote:
>
>
>
> > I'm confused on how to get data in request.session if a certain view
> > redirects the user using HttpRespon
Hi guys,
I'm confused on how to get data in request.session if a certain view
redirects the user using HttpResponseRedirect()
A sample code:
def view_start(request):
try:
Member(id)
except Exception, e:
# redirect to registration page if this id is not
re
Thanks Alex and matehat,
Concerning this issue of mine, I've decided to remove the images and
save the objects without the ImagingCore in them, which fixed the
whole thing.
On a different note, other than actively testing data which we want to
put into sessions before we design the application f
Hi guys,
In one of our views, we're getting the error below:
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/servers/
basehttp.py", line 278, in run
self.result = application(self.environ, self.start_response)
File "/usr/lib/python2.5/site-packages/d
Thank you Malcolm!
If that's the case then I'll streamlime everything to use save()
instead of going through the Manager, as I personally prefer explicit
than implicit.
Now I too, can sleep at night :)
On Apr 8, 12:13 pm, Malcolm Tredinnick
wrote:
> On Tue, 2009-04-07 at 20:10
Hi guys,
I'm a bit confused on inserting new data into the db via the models,
i.e in the docs
http://docs.djangoproject.com/en/dev/topics/db/queries/#topics-db-queries
a given example to add new data into a table is:
from mysite.blog.models import Blog
b = Blog(name='Beatles Blog', tagline='All
009-01-21 at 04:11 -0800, Iqbal Abdullah wrote:
> > Hi guys,
>
> > I need to support some browsers which doesn't handle cookies, so I
> > have followed the snippet here to manually get session ids from the
> > request:
> >http://www.djangosnippets.org/snippets
Hi guys,
I need to support some browsers which doesn't handle cookies, so I
have followed the snippet here to manually get session ids from the
request:
http://www.djangosnippets.org/snippets/460/
and positioned the new middleware before the SessionMiddleware in the
settings.py file.
I did an e
Hi Malcolm,
Thanks for the tip! It works like I wanted it to.
Thanks!
On Jan 20, 4:44 pm, Malcolm Tredinnick
wrote:
> On Mon, 2009-01-19 at 22:38 -0800, I.A wrote:
> > Hi guys,
> > I apologize for the confusing title.
>
> > I'm still confused on using the models in a m2m relationship. Suppose
15 matches
Mail list logo