Re: Automating deployments

2013-02-06 Thread Barry Morrison
I've got SaltStack setup to deploy Ubuntu+Nginx+uWSGI+Postgresql+memcache pretty easily. Pulls Django projects from Git, pip installs from requirements file. It is a lot less complicated than Puppet/Chef in my opinion. Just my $.03 cents On Friday, February 1, 2013 4:28:45 PM UTC-8, Marc A

Re: Upload multiple files using Ajax

2013-01-23 Thread Barry Morrison
I created this https://github.com/esacteksab/django-jquery-file-upload which is just jQuery-File-Upload ported to Django. It was a fork of someone elses' project that addressed my needs (support for models) On Wednesday, January 23, 2013 2:18:01 AM UTC-8, psjinx wrote: > > You can use https://gi

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-20 Thread Barry Morrison
e (article_id) "press_page_article_id_like" btree (article_id varchar_pattern_ops) Check constraints: "press_page_pgnumber_check" CHECK (pgnumber >= 0) Foreign-key constraints: "press_page_article_id_fkey" FOREIGN KEY (article_id) REFERENCES press_articl

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-20 Thread Barry Morrison
7;::text) On Friday, October 19, 2012 10:26:01 PM UTC-7, Sam Lai wrote: > > On 20 October 2012 14:16, Barry Morrison > > wrote: > > I've got a pretty expensive query...Wondering if I can't speed things up > in > > regards to Postgresql. >

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-20 Thread Barry Morrison
be interested in > https://docs.djangoproject.com/en/1.4/ref/models/querysets/#prefetch-related > > Regards, > Xavier Ordoquy, > Linovia. > > Le 20 oct. 2012 à 05:16, Barry Morrison a écrit : > > I've got a pretty expensive query...Wondering if I can't speed things

Re: Postgresql Index & expensive queries [n00bie alert]

2012-10-20 Thread Barry Morrison
uess what I need to do is clone my VPS off, firewall the crap out of it and run Django Debug Toolbar on that...giving me a more accurate idea of what's going on. Thanks for the response. On Fri, Oct 19, 2012 at 10:25 PM, Sam Lai wrote: > On 20 October 2012 14:16, Barry Morrison wrote: &g

Postgresql Index & expensive queries [n00bie alert]

2012-10-19 Thread Barry Morrison
I've got a pretty expensive query...Wondering if I can't speed things up in regards to Postgresql. Here is the model: [1] http://dpaste.org/JmEeQ/ Here is the sql statement: [2] http://dpaste.org/GbfAJ/ Here is the template: [3] http://dpaste.org/vxRs4/ Here is the 'guts' of the view: [4] h

Re: Is the logic in my model correct? Best-case?

2012-09-06 Thread Barry Morrison
tionForm, self).__init__(*args, **kwargs) The problem is, it creates drop-down/select fields instead of allowing me to create radio buttons. I guess I need to figure out how to parse through the distributors. On Thursday, September 6, 2012 11:59:13 AM UTC-7, Barry Morrison wrote: > >

Re: Is the logic in my model correct? Best-case?

2012-09-06 Thread Barry Morrison
t is distributed by a specific distributor. Do I need to create another field on the Distributor model and set a boolean field/widget? Thanks, Barry On Monday, September 3, 2012 8:45:07 PM UTC-7, Dennis Lee Bieber wrote: > > On Mon, 3 Sep 2012 18:51:45 -0700 (PDT), Barry Morrison > &

Re: Is the logic in my model correct? Best-case?

2012-09-04 Thread Barry Morrison
That's exactly what I needed. Thank you *very* much! On Mon, Sep 3, 2012 at 8:44 PM, Dennis Lee Bieber wrote: > On Mon, 3 Sep 2012 18:51:45 -0700 (PDT), Barry Morrison > declaimed the following in > gmane.comp.python.django.user: > > > Model: http://dpaste.org/dqwmc/ &g

Is the logic in my model correct? Best-case?

2012-09-03 Thread Barry Morrison
Model: http://dpaste.org/dqwmc/ There can be many products. There can be many distributors. A product could have none or more distributors. A distributor could only distribute a single product once. A distributor could distribute all products. I imagine a form (admin side): Product Name: Produ

Re: To Use or Not to Use the admin backend

2012-09-03 Thread Barry Morrison
My $.02 cents. It's great to have around while you're working, but my n00b experience taught me it left a lot to be desired so I rolled my own for the last two projects I built. FWIW, a local dev gave this quick presentation, and they did an incredible job on hacking the default admin https

Re: Not sure how to describe issue/behavior with Form -- so here's code & YouTube video

2012-08-24 Thread Barry Morrison
ve string #92 up ? super should be called before > other field initialization. > look like your prev activity is stored after init process and those > data is saved at the save operation. > try to print form to log after pressing cancel button > > thanks , serge > > 2

Re: Not sure how to describe issue/behavior with Form -- so here's code & YouTube video

2012-08-24 Thread Barry Morrison
the form, I want that object to no longer exist. I guess I want it to ONLY get created upon form submission. On Friday, August 24, 2012 3:01:32 AM UTC-7, Tom Evans wrote: > > On Fri, Aug 24, 2012 at 9:37 AM, Barry Morrison > > > wrote: > > Code: http://dpaste.org/az8N

Not sure how to describe issue/behavior with Form -- so here's code & YouTube video

2012-08-24 Thread Barry Morrison
Code: http://dpaste.org/az8Nb/ Video http://www.youtube.com/watch?v=XFSb044UkPs&feature=youtu.be so first action, I click + which adds new, hitting cancel, takes me back to the view displaying all the news events next action, I hit + again, adds new news event...this time I browse for an image,

Re: Redirect to page with query string

2012-08-19 Thread Barry Morrison
This actually ended up working: http://dpaste.org/U0uY4/ On Saturday, August 18, 2012 5:46:28 PM UTC-7, Melvyn Sopacua wrote: > > On 19-8-2012 2:26, Barry Morrison wrote: > > I have a view that displays images and gives me the ability to delete > the > > images.

Re: Redirect to page with query string

2012-08-18 Thread Barry Morrison
te 'GET' Full traceback: http://dpaste.org/QZ6uB/ Thanks, Barry On Sat, Aug 18, 2012 at 5:46 PM, Melvyn Sopacua wrote: > On 19-8-2012 2:26, Barry Morrison wrote: > > I have a view that displays images and gives me the ability to delete the > > images. > > > > Vie

Redirect to page with query string

2012-08-18 Thread Barry Morrison
I have a view that displays images and gives me the ability to delete the images. View url == /account/community/images/1 (1 == event_id) That url will display all images associated with event_id=1 Each image displays a 'delete' url that calls /account/press/page/delete/{{ image.pk }} -- t

Django-tagging | Filtering results

2012-07-05 Thread Barry Morrison
Total brain block. code: https://gist.github.com/2c70c0992ba14ded1593 The desired result is something like this /favs/ will show all favorites (no tag cloud) /favs/Source1 Will display tag cloud associated with only Source1 /favs/Source2 will display tag cloud associated with only Source2

Re: DetailView - invalid literal for int() with base 10:

2012-07-05 Thread Barry Morrison
m not sure without running it, which I can't do now. I have noticed > that your slug is not and id, but the field PostSubReddit is a foerignkey > which might expect an id. > > Unrelated, I think your models shouldn't be pluralised (e.g. Post instead > of Posts). I

DetailView - invalid literal for int() with base 10:

2012-07-05 Thread Barry Morrison
I've been beating my head against this all night and now into the morning...I have NO idea what I'm doing wrong and Google and Stack Overflow haven't been as helpful as I had hoped. https://gist.github.com/7dc0b98a2fe056379ae8 Any help or guidance would be greatly appreciated! Thanks!! --

Re: Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Barry Morrison
ail.url }} > > _Nik > > On 7/4/2012 5:13 PM, Barry Morrison wrote: > > I have a bunch of press articles, these articles are basically > > thumbnails that open up to the pages of the articles. > > > > Here's what I've got so far. > > > >

Article Viewer / Better way to do this? / Suggestions Please

2012-07-04 Thread Barry Morrison
I have a bunch of press articles, these articles are basically thumbnails that open up to the pages of the articles. Here's what I've got so far. https://gist.github.com/0951804f4592c970b18b My thoughts are to use something like Django's pagination [1] https://docs.djangoproject.com/en/1.4/topic

django-crispy-forms not displaying button

2012-06-06 Thread Barry Morrison
forms.py = http://dpaste.org/POItz/ html = http://dpaste.org/VsIjL/ Django 1.3.1 crispy-forms 1.1 Not sure why this isn't working. It's simply not generating the necessary for the button to exist. Any help would be GREATLY appreciated! Thanks, Barry -- You received this message because

Re: form.Forms + POST + forms.ChoiceField

2012-04-02 Thread Barry Morrison
nterested we can start. Also if you would like to add > some other areas let me know > > Thanks, > Serge > > 2012/4/2 Barry Morrison : > > Too much code? I'd rather too much than not enough, but if it'd help, I > can > > cut down on future posts. >

Re: form.Forms + POST + forms.ChoiceField

2012-04-02 Thread Barry Morrison
ces=sources) > > This mean that you never add any sources. or sources object are add > before starting application. For dynamic loading objects in the form > use form constructor. > and last one point : > > Please separate views and form in the different files : views.

form.Forms + POST + forms.ChoiceField

2012-04-01 Thread Barry Morrison
Full Disclosure: I've been using Python for 5-6 months. Django for maybe 3 I have this: https://gist.github.com/a934fe08643e0c3ee017 In an effort to teach myself, I'm simply building a Django app. For teaching purposes only. It's an aggregator of favorites across multiple sites. Right now, I'm