Re: import problem

2012-02-16 Thread DrBloodmoney
On Thu, Feb 16, 2012 at 9:20 AM, Scott Macri <scottma...@gmail.com> wrote: > DrBloodmoney I not sure what you mean by circular imports.  datetime > is the only import I have in this file. Here are examples of circular import problems [1][2] I am forever getting bitten by them, so it'

Re: import problem

2012-02-15 Thread DrBloodmoney
On Wed, Feb 15, 2012 at 10:48 PM, Scott wrote: > Hello, > I'm having a strange issue and have already spent an hour trying to > figure it out. > > I created a python app called mn.  Then I setup all my models and > stuff to work under mn.hcp.  Everything has been working

Re: Checkboxes for a list of items like in Django admin interface

2012-01-04 Thread DrBloodmoney
On Wed, Jan 4, 2012 at 5:33 AM, Martin Tiršel wrote: > Hello, > > I have a list of items (from a model) I want to display with checkboxes (for > deleting multiple objects at once). The same behaviour like in django admin > (change list). I can do such thing in templates: > >

Re: auth.login function not working as expected

2011-12-19 Thread DrBloodmoney
On Sun, Dec 18, 2011 at 4:25 PM, Abraham Yusuf wrote: > Hi all, > I'm trying to login a user using django's authentication backend with the > following: > user=auth.authenticate(userid,pass) > if user: >   if user.is_active: >      auth.login(request,user) > I am getting

Re: add project directory path to python path permanently

2011-12-01 Thread DrBloodmoney
On Thu, Dec 1, 2011 at 5:59 AM, Nikhil Verma wrote: > > Hi all, > > I want to add my django project directory path to PYTHONPATH. I am a newbie > in ubuntu 11.10 > Please tell me step by step. When i do import sys sys.path.append(''project_directory path") > It

Re: Using request.POST.copy() to get hidden field in html template

2011-11-30 Thread DrBloodmoney
On Wed, Nov 30, 2011 at 7:43 PM, jim wrote: > I'm trying to use request.POST.copy() to get a hidden field in an html > template.  The hidden field looks like: > > > > I also tried: > > > > In my view.py I have: > >      postdata = request.POST.copy() >       url =

Re: Process management with Supervisord

2011-11-30 Thread DrBloodmoney
On Wed, Nov 30, 2011 at 9:35 AM, Andre Lopes wrote: > Hi, > > I'm serving to production a Django website with Nginx + Gunicorn with > virtualenv. > > My dumb question is: I must to install supervisord in my virtualenv or > outside my virtualenv? You should just install

Re: A view associated with a lot of urls

2011-11-29 Thread DrBloodmoney
On Tue, Nov 29, 2011 at 3:37 PM, Nolhian wrote: > Thanks ! > > So you'll not check if the category/item exists ( if a user enter a > bad url ), you'll just hit the database to check if it does in fact > exists ? No I don't know what your business logic for the view/model

Re: Nginx - How to configure the virtual.conf to serve a Django application

2011-11-29 Thread DrBloodmoney
On Tue, Nov 29, 2011 at 3:05 PM, Andre Lopes wrote: > I'm trying to serve a Django application to production. I have > installed Gunicorn and now I need to setup a Nginx Virtual Host. I'm > kind of lost on how to configure the "virtual.conf" from Nginx. I just > want to

Re: A view associated with a lot of urls

2011-11-29 Thread DrBloodmoney
On Tue, Nov 29, 2011 at 2:19 PM, Nolhian wrote: > Thanks you for your answer, yes I plan on using different models for > the lookups. But I'm confused, is that a yes to my question, Lists/ > dicts are the way to go here ? I would not do it that way. Seems incredibly brittle

Re: Django : CSRF and variable handling in a view

2011-11-23 Thread DrBloodmoney
> If I don't check anywhere in the view if a user is authenticated, he > can still use the form to post data and my goal is that if a user is > authenticated he can't ( in the template if a user is authenticated it > doesn't display the form ). > I'm aware that it kind of defy the DRY principle

Re: Perhaps more of a general Python question, but..

2011-11-23 Thread DrBloodmoney
On Wed, Nov 23, 2011 at 2:01 PM, Jeff Heard wrote: > I have several django apps. all of which are in separate packages and can be > installed seperately.  I would like them all to be sub-packages of a master > package named "ga" So: > ga.datacube > ga.pyramid >

Re: Django : CSRF and variable handling in a view

2011-11-22 Thread DrBloodmoney
On Tue, Nov 22, 2011 at 6:54 PM, Nolhian wrote: > Hello, > > I've got a subscription form and this view : > > def index(request): >        c = RequestContext(request) >        if request.user.is_authenticated(): >                return render_to_response('index.html',

Re: browser detection in django

2011-11-18 Thread DrBloodmoney
Well if it is IE then you can do conditional commenting for IE to detect itself: css -- 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

Re: Extend user model multiple times

2011-11-18 Thread DrBloodmoney
Personally I think get_profile() is an anti-pattern, just access it like any other OneToOneField (and that's what you want... not unique=True on a ForeignKey). Just set up a models.OneToOneField(User, related_name=XXX), then you can access the profile as user.XXX. The User model and all of its

Re: Programming logic in Classed Based FormView or in the Form Itself?

2011-09-22 Thread DrBloodmoney
On Thu, Sep 22, 2011 at 11:14 AM, Kurtis wrote: > Hey, > > I'm trying to figure out the best way to do this. I have a FormView > and an associated Form. In my Form, I take care of all of the > validation and cleaning as far as the input goes. > > However, I need to put

Re: Dealing with misc parts of a project

2011-09-22 Thread DrBloodmoney
On Thu, Sep 22, 2011 at 12:30 PM, Micky Hulse wrote: > On Thu, Sep 22, 2011 at 8:54 AM, Simon Connah > wrote: >> So do you just tend to create a new misc app to hold all these little bits >> and pieces or is there a convention for such things? > >

Re: request.method not working as expected

2011-09-20 Thread DrBloodmoney
On Tue, Sep 20, 2011 at 11:46 AM, Fabio Natali wrote: > Hi everybody! > > I have a very simple view which is supposed to print out GET or POST, > depending which has been used to send data. The problem is I always get > "GET" even when sending data via POST. > > ### views.py: >

Re: Virtualenv and Django in Production

2011-09-20 Thread DrBloodmoney
On Tue, Sep 20, 2011 at 1:55 AM, adrian s wrote: > Hi all, I've been using virtualenv as recommended in my development > environments. > I am now migrating a project which was not using virtualenv, to another > server and now > have the opportunity to use it in production.

Re: Removing SECRET_KEY from settings.py

2011-09-17 Thread DrBloodmoney
On Fri, Sep 16, 2011 at 8:54 PM, Tim Chase wrote: > Just returning to some Django work after a time away, I (re)started an old > project in 1.3 and hit an early issue.  I'd like to keep my settings.py > under revision-control that is somewhat publicly accessible,

Re: intercept calls to reverse(..) in tests

2011-09-17 Thread DrBloodmoney
On Sat, Sep 17, 2011 at 7:47 AM, Reikje wrote: > Okay I am having some troubles getting this to work. In my application > I am using WebTest and django-webtest to do template testing. In order > to monkeypatch the django.core.urlresolvers.reverse function, I have > created

Re: django-registration + csrf token

2011-09-11 Thread DrBloodmoney
On Fri, Sep 9, 2011 at 12:02 PM, Brett Hutley wrote: > You need to add it to the registration_form.html as well. > > Make sure you have  'django.middleware.csrf.CsrfViewMiddleware', in the > MIDDLEWARE_CLASSES tuple in the settings.py file. > > Cheers, Brett > > On 9 Sep 2011,

Re: Best approach to handling different types of Users

2011-08-19 Thread DrBloodmoney
On Fri, Aug 19, 2011 at 9:27 AM, Andre Terra wrote: > Alright, do what you will. Whatever floats your boat.. > > On Fri, Aug 19, 2011 at 5:12 AM, Matt Schinckel wrote: >> >> On Friday, August 19, 2011 12:07:44 PM UTC+9:30, Andre Terra (airstrike) >>

Re: How control access to static pages that are *not* part of a Django app?

2011-08-01 Thread DrBloodmoney
On Mon, Aug 1, 2011 at 3:51 PM, Chris Seberino <cseber...@gmail.com> wrote: > > > On Aug 1, 7:11 am, DrBloodmoney <drbloodmo...@gmail.com> wrote: >> You can look into protecting them with mod_xsendfile for Apache > > Thanks.  I'll look into that.  Is there no way

Re: How control access to static pages that are *not* part of a Django app?

2011-08-01 Thread DrBloodmoney
On Mon, Aug 1, 2011 at 1:12 AM, Chris Seberino wrote: > My Django app only allows someone to access a /books page, that is > part of the Django app, if they are signed in. > > The pages below that URL are just static directory listings of PDFs > all handled by Apache. > For

Re: 3-legged-OAuth Logout

2011-07-25 Thread DrBloodmoney
On Mon, Jul 25, 2011 at 5:47 AM, Vignesh Sunder wrote: > Hi. I was just curious to know about the logout functionality of > OAuth..When a User logs out from the Consumer (After 3-legged OAuth > login) site, the User's session happens to get flushed. But I believe > this

Re: Need help intercepting SQL

2011-07-11 Thread DrBloodmoney
I think that you would probably have better luck coming at it from the other end. That is, in the database itself (stored procedure or otherwise). -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Complex Query help - get items from the org to which the user belongs

2011-07-07 Thread DrBloodmoney
On Thu, Jul 7, 2011 at 12:04 AM, Venkatraman S wrote: > I am doing some bechmarking on the performance of both the versions of the > query: > 1. > Item.objects.filter(created_by__employees__org__in=u.employees_set.all().values_list('org')) > and > 2.

Re: Dreamhost Virtualenv Question

2011-07-06 Thread DrBloodmoney
On Wed, Jul 6, 2011 at 3:31 AM, i...@webbricks.co.uk wrote: > oh yeah > http://www.saltycrane.com/blog/2009/05/notes-using-pip-and-virtualenv-django/ > > that page is my goto reference on building a virtualenv, you might > have already found it, but if not... > > On Jul 5,

Re: Questions on markdown

2011-07-05 Thread DrBloodmoney
On Mon, Jul 4, 2011 at 2:22 PM, Petite Abeille wrote: > > On Jul 4, 2011, at 8:08 PM, leo wrote: > >> what i want is > > To quote the friendly manual: > > "When you do want to insert a break tag using Markdown, you end a line > with two or more spaces, then type

Re: Setting up EC2 for Django

2011-07-05 Thread DrBloodmoney
On Sat, Jul 2, 2011 at 10:14 AM, Soviet wrote: > Hello > I need to set up EC2 instance to run Django+Python+PostgreSQL+Apache > +Solr+nginx+Mercurial etc. This is all black magic for me - I was only > using shared hosting like webfaction, where everything is dumb- > friendly

Re: Alternate user fields

2011-06-20 Thread DrBloodmoney
On Mon, Jun 20, 2011 at 5:16 PM, raj wrote: > Sorry, can you give me more details. What other things would I have to > do to make these changes? thank you. > > On Jun 20, 3:08 am, Kenneth Gonsalves wrote: >> On Mon, 2011-06-20 at 00:03 -0700, raj

Re: Unit-Testing Dilemma

2011-06-20 Thread DrBloodmoney
On Mon, Jun 20, 2011 at 3:52 PM, Nan wrote: > I'm not testing the third-party service.  I need to test *what I send > to them*.  I.e. that the output of my_view is correct.  The trouble is > that neither my_view nor the API call actually returns the output that > I need to

Re: Updating static files: Still in browser cache

2011-06-09 Thread DrBloodmoney
On Thu, Jun 9, 2011 at 9:16 AM, Malcolm Box wrote: > On 9 June 2011 08:09, Thomas Guettler wrote: >> >> My static files (JS/CSS) are cached in the browser. But if there is a bug >> in a file, an update won't help people which have already cached the old

Re: Chained forms

2011-05-31 Thread DrBloodmoney
On Tue, May 31, 2011 at 12:55 PM, Marc Aymerich wrote: > Hi!, > I'm writing an admin action. > This action needs to collect some information before execute the "final > task". > In order to collect this information the user should fill 3 consecutive > forms, (once they

Re: How do you organize your deployment enviroment

2011-05-25 Thread DrBloodmoney
Yeah. That was the post I was thinking about. For some reason I thought that it came from the core dev team. I still think that migrations should be a part of a full-stack framework like django (south is the first app I install in a new project). They might as well pick the best-in-breed and throw

Re: How do you organize your deployment enviroment

2011-05-25 Thread DrBloodmoney
On Wed, May 25, 2011 at 9:31 AM, DK wrote: > 100% south migration :) This. I know that they have said that they weren't going to be putting South into django (contrib?), but I wish they would. Most django devs should be using it. -- You received this message because you are

Re: South migration for fixtures

2011-05-25 Thread DrBloodmoney
On Wed, May 25, 2011 at 12:54 PM, Amit Sethi wrote: > Hi all , I might be wrong with some of the concepts as I am new to > south. I am using south to migrate some fixture data for a django app. > Also something worth noting is I am bringing south new into the django >

Re: Django password reset modification

2011-05-06 Thread DrBloodmoney
On Fri, May 6, 2011 at 12:36 AM, Phui-Hock wrote: > On May 6, 4:22 am, Shawn Milochik wrote: >> This is a bad idea for multiple reasons. Don't do it. > > Huh, care to explain, please? Please Please Please do not send plain text passwords via email.

Re: Custom form field

2011-04-20 Thread DrBloodmoney
On Wed, Apr 20, 2011 at 12:45 PM, Daniel Gagnon wrote: > Sure, here's a minimal version of them (I skipped fields that aren't too > relevant to the problem at hand because there's many, including tons of > foreign keys): > class Target(Model): >     name = CharField("Target

Re: Custom form field

2011-04-20 Thread DrBloodmoney
self to the widget instead of passing > object.id ? > On Wed, Apr 20, 2011 at 12:17 PM, DrBloodmoney <drbloodmo...@gmail.com> > wrote: >> >> On Wed, Apr 20, 2011 at 11:48 AM, Daniel Gagnon <redalas...@gmail.com> >> wrote: >> > So far, I have the followi

Re: Custom form field

2011-04-20 Thread DrBloodmoney
On Wed, Apr 20, 2011 at 11:48 AM, Daniel Gagnon wrote: > So far, I have the following code: > from django.forms.widgets import TextInput > from django.forms.fields import Field > class AutoCompleteWidget(TextInput): >     def render(self, name, value, attrs=None): >         

Re: Can't build Django documentation

2010-08-14 Thread DrBloodmoney
On Fri, Aug 13, 2010 at 11:11 PM, Kevin wrote: > I tried to build the Django docs and got an error. > > $ cd django/docs/ > $ make html > sphinx-build -b djangohtml -d _build/doctrees   . _build/html > Running Sphinx v1.0.1 > loading pickled environment... not yet created >

Re: request.is_ajax() good practices

2010-07-21 Thread DrBloodmoney
On Wed, Jul 21, 2010 at 1:37 PM, Juan Hernandez wrote: > Hey there, > I have been working a lot with request.is_ajax() to handle forms and the > results have been great so fat yet, I have a question about good practices > and best uses for this function. > Lets say that I

HIPAA experience

2010-06-10 Thread DrBloodmoney
Hello, I was hoping that some of the list members who have experience building HIPAA-compliant (or SOX-compliant) django apps could share some of their experiences. We are beginning to research possibly implementing some internal apps in our department, but of course working with patient data

Re: Why must {% extends '' %} be first value in template? Inconvenient for ajax versions.

2010-03-28 Thread DrBloodmoney
On Sat, Mar 27, 2010 at 9:29 PM, David Hollander wrote: > Hello. I am making a restaurant site with some visually candy that > will load all new subpages via AJAX. And also load pages normally > without AJAX if javascript is disabled. > > Ideally, I want to do: > > {% if not

Re: AJAX Autocompletion Field

2010-02-16 Thread DrBloodmoney
I'll just point out that the jQuery Autocomplete plugin is included (will be included) in the next jQueryUI release. I think it's been pretty easy to hook into views On Feb 15, 2010 6:00 AM, "Massimiliano della Rovere" < massimiliano.dellarov...@gmail.com> wrote: I'd use http://dajaxproject.com/

Re: Complicated Form "Workflow" - Need ideas/direction

2009-12-15 Thread DrBloodmoney
When I run into similar situations with regards to flow, interface, I try to approach from a different angle. In this case, where you have different checks (before they can create an Event, the venue must exist, etc.) I line those up first. - Create event view, select Venue. - If venue does not

Re: Working the tutorial - and I'm stuck

2009-11-03 Thread DrBloodmoney
Make sure that you have the CSRF middleware installed. On Nov 3, 2009 12:09 PM, "Todd Blanchard" wrote: What did I screw up? TemplateSyntaxError at /polls/1/ Invalid block tag: 'csrf_token' Request Method:GETRequest URL:http://localhost:8000/polls/1/Exception Type:

Newbie question regarding django-authopenid

2009-06-08 Thread DrBloodmoney
For those who have used django-authopenid [1], can you tell me if it interferes with the built-in django user authentication system (users, permissions, groups, etc). I am going to attempt to get it running on a small project, but I won't bother if it interferes with auth. Thank you in advance