PRG with View classes

2012-04-17 Thread dmitry b
hi, Is there out of the box support for the PRG pattern with Django's new class-based views? If not, what's a good/preferred way of implementing one? Thanks D. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the

Re: anti-join query in Django

2011-11-21 Thread dmitry b
t, Nov 19, 2011 at 8:41 AM, dmitry b <dmitry.ma...@gmail.com> wrote: > > Is there a recommended approach to anti-join queries?  Here's the > > query I'm having an issue with: > > > Branch.objects.filter(branchgroup__isnull=True)[:1] > > > where branchgroup is a

anti-join query in Django

2011-11-18 Thread dmitry b
Is there a recommended approach to anti-join queries? Here's the query I'm having an issue with: Branch.objects.filter(branchgroup__isnull=True)[:1] where branchgroup is a ManytoMany relationship to another model. I want to get a set of Branch objects that aren't mapped to any BranchGroups.

custom management command with multiple required parameters

2011-11-16 Thread dmitry b
Hi, I just want to make sure I'm not missing something obvious. I'm writing a command that takes multiple required parameters and a set of optional parameters and I there doesn't seem to be readily available support for this use case. LabelCommand can take multiple labels, but the semantics of

CAS and Django cache

2011-10-26 Thread dmitry b
Can I do check-and-set operations using Django's cache api? Thanks D. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread dmitry b
t doesn't. If I try an aggregate query such as > using COUNT(account_number) without the Where clause, I get a row with > 0 in it (there are thousands of account_numbers). > > Thanks for the suggestion. > > On Oct 19, 1:30 pm, dmitry b <dmitry.ma...@gmail.com> wrote: >

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread dmitry b
see if a pamaterized query works: cursor.execute('SELECT account_number FROM vw_billed_summary_fact WHERE ippa=%s', ['col11-emnj00-1147']) d. On Oct 19, 8:25 am, msbuck wrote: > I'm having another strange problem. I'm executing SQL statements > directly rather than using

collectstatic in RPM install

2011-10-18 Thread dmitry b
Hi, For deployment to production, I package my Django app into an RPM package. The install script is responsible for installing dependencies, copying files, etc. Now that I've switched to Django 1.3 I also want to run the collectstatic command as part of the deployment script. To do this, I've

name conflicts in static files

2011-10-17 Thread dmitry b
Hi, With the new way of handling static files in Django 1.3 what would happen if two applications have identically named static files? E.g.: |___ app1 | | static | |_ styles.css |___ app2 | static |_ styles.css

Re: check for existence in bulk

2011-03-31 Thread dmitry b
thanks, that's what I ended up using. On Mar 30, 11:58 am, Jason Culverhouse wrote: > You could use values_list  and flat as in: > >    User.objects.filter(username__in =['jason', 'was', > 'here']).values_list('username', flat=True) > > returns a list: > >    [u'jason',

check for existence in bulk

2011-03-30 Thread dmitry b
Hi, is there a way to check in bulk for record existence and get back a map of results similar to what's returned by in_bulk(). In my case, I need to look up records by a unique field which is not the primary key and I don't want object instances back, just true or false. Thanks Dmitry --

Re: Working with static media files, {{ MEDIA_URL }} shows up blank even with settings.py set

2010-12-28 Thread dmitry b
you need to be also using RequestContext in your view instead of the regular Context. What does your view method's return statement look like? On Dec 28, 7:02 am, Lee Connell wrote: > I didn't have TEMPLATE_CONTEXT_PROCESSORS at all, I copied the code > and it did not

Re: Suspending tasks in response to a systematic transient error

2010-12-21 Thread dmitry b
Woops, sorry, please ignore. I posted this to a wrong group. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Suspending tasks in response to a systematic transient error

2010-12-21 Thread dmitry b
Hi, Let's say I have several hundred instances of a task waiting in a queue and this task needs a database connection to complete successfully. Somewhere along the way the database goes down, so tasks are starting to fail one after another. When this happens (say when ), is there a way to

Re: registering app level signal handlers

2010-12-18 Thread dmitry b
On Dec 18, 1:44 am, Łukasz Rekucki wrote: >[...]The problem with putting signal handlers > in __init__, is that it isn't the place you would really expect Model > related code to live (like post_save). It can also lead to non-obvious > cyclic imports, 'cause your handler code

Re: registering app level signal handlers

2010-12-17 Thread dmitry b
Aren't an app's models loaded lazily (upon the first use)? On Dec 16, 7:16 pm, "W. Craig Trader" wrote: > I usually register the signals for a given application at the bottom of that > app's model.py file. > > - Craig - -- You received this message because you are

Re: registering app level signal handlers

2010-12-16 Thread dmitry b
On Dec 16, 3:28 pm, Graham Dumpleton <graham.dumple...@gmail.com> wrote: > On Friday, December 17, 2010 10:00:55 AM UTC+11, dmitry b wrote: > > Are you talking about UNIX process signals? I'm sorry, I forgot there are two ways to interpret my question. It is about Django si

registering app level signal handlers

2010-12-16 Thread dmitry b
Hi, What is the best place to register a signal handler so that the registration happens when the app is first initialized into django? I have an app that needs to listen to signals generated by another app and fire off celery tasks in response. I've tried placing the registration code into the

FileField and location and storage

2010-12-08 Thread dmitry b
Hi, I've written a custom Storage that uses WebDAV as its underlying engine. When I save a file '/foo/bar/file.ext', I want it to be saved under /foo/bar in the webdav filesystem. However, it seems that FileField overrides the directory structure: def generate_filename(self, instance,

handling generated files

2010-12-07 Thread dmitry b
Hi, How do I use Django's FileField with autogenerated files? That is, these files aren't uploaded by a user, but rather are created on the fly. I've looked at ContentFile, but this class doesn't seem to have a way to attach a file name (the name is also computed at run-time based on some

disabling session management for certain requests

2010-08-17 Thread dmitry b
Hi, My application has both stateful and stateless (REST) views. Stateful views primarily back browser-based GUI, while stateless are for RESTful service requests. Is there a way to disable session management for the stateless requests? Thanks Dmitry -- You received this message because

transactions in management commands

2010-08-17 Thread dmitry b
Hi, What's the default transaction mode for django management commands? Thanks Dmitry -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send

expressions in values()

2010-06-30 Thread dmitry b
Hi, I have the following query: AnalyzedFile.objects.filter(bug_signature__bug_condition__tracked_change=cr).values("scm__path") In other words, the result is a list of AnalizedFile.scm.path values. I'd like to change the query so that the returned value is a combination of two fields: scm.path

Re: enumerating view functions

2010-06-19 Thread dmitry b
Oops. Didn't see you reply. Thanks, I'll take a look at the command extension. BTW, the second link you provided is my own snippet :) I want to improve it with auto documentation extracted from the actual view functions. On Jun 16, 11:40 am, Alexis Roda

Re: db autoclobbering with automated tests

2010-05-27 Thread dmitry b
So, no one is running automated tests? On May 24, 4:16 pm, dmitry b <dmitry.ma...@gmail.com> wrote: > Hi, > > I'm in the process of setting up automated selenium tests for a django > app using Hudson.  As part of the build script, I'm starting up a test > server: &g

db autoclobbering with automated tests

2010-05-24 Thread dmitry b
Hi, I'm in the process of setting up automated selenium tests for a django app using Hudson. As part of the build script, I'm starting up a test server: $> python manage.py testserver --addrport 0.0.0.0:8080 ../../test/gui/ seed_data.json However, when this line runs, I get the following