Re: Can't display data from app in flatpages

2012-12-20 Thread Jason Arnst-Goodrich
The flatpages view is not provided the context which includes 'posts'. IMO you are correct with the {% load posts %} technique because it is entirely as result of the template you are using that requires you display that information -- if that makes sense. In other words it's not because of the

Re: How can i redirect a form to amother page when validation is correct

2013-01-24 Thread Jason Arnst-Goodrich
It's not redirecting because the following statement never evaluates to True: if accept is not None and accept.is_active: You are using auth.authenticate (see below) but I don't think that's what you want in this case. auth is the built in django auth system which your code isn't using. acce

Re: Error passing data from views to template

2013-02-18 Thread Jason Arnst-Goodrich
return render_to_response('home/about.html', data, 'context_instance=RequestContext(request)') Change that to: return render_to_response('home/about.html', data, context_instance=RequestContext(request)) The context_instance is an optional keyword argument. Right now you're passing it as a po

Re: Django Form Designer

2013-03-08 Thread Jason Arnst-Goodrich
I never knew this existed. I do hope someone continues development... On Thursday, March 7, 2013 8:39:56 AM UTC-8, Daniele Procida wrote: > > I like and use Django Form Designer, < > https://github.com/philomat/django-form-designer>, but it hasn't been > updated for a while and needs some work.

Re: linux or windows

2013-05-31 Thread Jason Arnst-Goodrich
I'd just like to chime in as another "develop on windows, deploy to linux" guys. It's worked fine for me for years. Like people have said, sometimes it's hard to get certain libraries for Windows installed but it's usually not to hard to find a packaged solution if you google (and in simple pro

Re: On live site, DatabaseError tables not found; dbshell shows tables but apache can't find the database?

2013-06-08 Thread Jason Arnst-Goodrich
Does apache have write permissions on the DB folder(s). I know you'll get errors if you don't have permission for the db file itself AND the folder containing it. On Saturday, June 8, 2013 10:16:46 AM UTC-7, Brian Lee wrote: > > Very good guess... but I looked and in both manage.py and mysite/

Class Based CreateView with foreign key question

2013-06-10 Thread Jason Arnst-Goodrich
I'm having trouble wrapping my head around how to use generic class based views properly when it comes to creating objects associated with already created objects. The concept here is adding File objects to a Case object. The url pattern would be something like: url(r'^case/(?P\d+)/add/$', Add

Re: Class Based CreateView with foreign key question

2013-06-11 Thread Jason Arnst-Goodrich
:38:09 PM UTC-7, Jason Arnst-Goodrich wrote: > > I'm having trouble wrapping my head around how to use generic class based > views properly when it comes to creating objects associated with already > created objects. > > The concept here is adding File objects to a Cas

Re: Class Based CreateView with foreign key question

2013-06-13 Thread Jason Arnst-Goodrich
That reassures me then. In the past I stayed away from the generic class based views and in my current project I'm using nothing but them. Everything is working but it's not clear by looking at it *why* it works. There might be a little too much magic happening for my liking but I'm going to s

Re: Class Based CreateView with foreign key question

2013-06-13 Thread Jason Arnst-Goodrich
I should also clarify just in case anyone else runs into the same problem in the future: My form_valid() was not working correctly because I had my form definition excluding a (required) field so it would NEVER be able to save my model under any circumstance. def form_valid(self, form):

Re: Django ModelForm is_valid & form_valid

2013-06-20 Thread Jason Arnst-Goodrich
This is a common problem to run into. def form_valid(self, form): customer = form.save(commit=False) customer.store = self.request.user.active_profile.store customer.save() return super(CustomerInformationView, self).save(form) super(CustomerInformationView, self).save(form)doesn't really

Re: How to access request/session information from model.clean?

2013-06-21 Thread Jason Arnst-Goodrich
If you want to update the initially selected value (but still allow the user to select a different site)I think you're on the right track with ModelAdmin.get_form If you want to completely restrict them to their current session's site you'll want to use a combination of ModelAdmin.get_form (to

Re: An easy way to integrate Jcrop in Django's admin?

2013-06-26 Thread Jason Arnst-Goodrich
As a former PHP programmer who's switched to Django - Trying to modify the administration app can be hard. It's something I still stay away from because I feel once you start adding functionality that doesn't come working out of the box, you're better off building your own admin app. I don't t

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2013-06-28 Thread Jason Arnst-Goodrich
I just stumbled on this and it looks absolutely amazing. I do have one request though: can we get a sample project up that uses Google's authenticator (or anything else). This looks like the best solution for two factor authentication for Django but I don't think many people will know where to

Re: A PHP framework with some Django features?

2013-06-28 Thread Jason Arnst-Goodrich
Nobody's ever switched FROM Django TO PHP as far as I know :) But like others have already said - there's plenty of good frameworks that accomplish the same things Django does in PHP. Unless you truly love PHP I'd take the time to learn Django instead. :P On Friday, June 28, 2013 10:17:50 AM UT

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2013-07-01 Thread Jason Arnst-Goodrich
eate a TOTP or HOTP device (usually the former), encode the key with > base32, build a URI as documented, and render a QR code for the user to > scan. Alternatively, the user can also type the base32-encoded key in > manually. > > > [1] http://code.google.com/p/google-aut

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2013-07-02 Thread Jason Arnst-Goodrich
xists? Or allow some parameter controlling the save on the method? Or maybe provide a separate class method? On Monday, July 1, 2013 10:14:35 PM UTC-7, Jason Arnst-Goodrich wrote: > > I'm glad you saw my message - if nothing else just so you know this > project is appreciated. >

Re: Install MySQL for Python Django on my Windows PC

2013-08-06 Thread Jason Arnst-Goodrich
Another tip is to check out Bitnami. I've used them a couple times now (both VMs and stack installs). They do a pretty good job of getting a stack you want on Windows real fast. http://bitnami.com/stack/django/installer (note it comes with MySQL and Postgres) -- You received this message beca

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2013-08-09 Thread Jason Arnst-Goodrich
een the decorated-view pattern and the > view-as-class pattern. In any case, I expanded the otp_required decorator > to take an if_configured argument. New versions of django-otp and > django-otp-agents are available. > > Thanks so much for your feedback. Do keep in touch

Re: ANN: django-otp and friends: one-time passwords and trusted agents

2013-08-09 Thread Jason Arnst-Goodrich
I thought about that and I didn't like that it logged them in if they failed the OTP token. I'll probably use it for now. The only reason being I want them to do it in a single "attempt session". If they login half way and leave for a couples minutes I want them to supply the regular login cred

Re: Creating an "Edit Page"

2013-08-13 Thread Jason Arnst-Goodrich
You might want to look into class based views: https://docs.djangoproject.com/en/dev/topics/class-based-views/ These are then extended to create "generic views" that handle a lot of these common patterns. there's something called an "UpdateView" that handles this exact pattern: https://docs.dja

Re: Representing infinity or "no limit" in an integer field?

2013-08-19 Thread Jason Arnst-Goodrich
> > Problem is that usually databases aren't very fast to search NULL values > so if you have to for example produce often list of products that you can > buy "infinite amount", you would like to consider using value(s) that don't > conflict from valid set of values. I'm pretty sure that's no

Re: Representing infinity or "no limit" in an integer field?

2013-08-20 Thread Jason Arnst-Goodrich
inen wrote: > > On Mon, 19 Aug 2013 11:14:54 -0700 (PDT) > Jason Arnst-Goodrich > wrote: > > > > > > > > > Problem is that usually databases aren't very fast to search NULL > values > > > so if you have to for example produce often list of p

Re: Django ORM: default value from sql query

2013-08-22 Thread Jason Arnst-Goodrich
I don't think that will work because the default value is unrelated to a specific instance of a model and you want it to depend on the instance if I'm not mistaken. Once the instance exists, we're past the point where a default value will be used. I think you'll have to handle this in a view.

Re: Widget isn't sticking?

2013-11-13 Thread Jason Arnst-Goodrich
Try: expiry_date = forms.DateField(widget=CalendarWidget()) On Tuesday, November 12, 2013 5:41:27 PM UTC-8, Lachlan Musicman wrote: > > Hola, > > I've set up a CalendarWidget as per the docs > https://docs.djangoproject.com/en/1.6/topics/forms/media/ and can see > correct results in the shell:

Re: Widget isn't sticking?

2013-11-13 Thread Jason Arnst-Goodrich
7;datepicker'})) On Wednesday, November 13, 2013 1:31:40 PM UTC-8, Lachlan Musicman wrote: > > Nothing, unfortunately. > > On 14 November 2013 07:37, Jason Arnst-Goodrich > > > wrote: > > Try: > > > > expiry_date = forms.DateField(widget=Ca

Re: Timeseries Data Collection as a Reusable App

2014-03-11 Thread Jason Arnst-Goodrich
Without knowing much about your specifics, I would suggest looking into MongoDB. You'll have some of the issues in #2 and you obviously won't have a generic app that people without Mongo can use but I'd at least look into it before you go any further. On Tuesday, March 11, 2014 8:42:24 AM UTC-7

Re: Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-14 Thread Jason Arnst-Goodrich
You're passing two different dictionary parameters there. Try something like this: ctx = { 'customers':customers, 'form': form } return render_to_response('index.html', ctx) On Wednesday, May 14, 2014 3:22:22 PM UTC-7, G Z wrote: > > def index(request): > form = SignUpFo