Re: Possible Basic kwargs question.

2013-04-16 Thread Brad Pitcher
It should be: model.method1(**params) On Apr 16, 2013 7:49 PM, "jayhalleaux" wrote: > Not really a Django question but I'm trying to create a model method that > does not have a fixed set of parameters. > > models.py > Class Model_A(model.Model): > ... > > def method1(self, **kwargs): > > print p

Re: Possible Basic kwargs question.

2013-04-16 Thread Brad Pitcher
ram1'], etc > > Why even unpack the dictionary? I could just pass the dictionary instead. > > > On Tuesday, April 16, 2013 11:08:42 PM UTC-4, Brad Pitcher wrote: > >> It should be: >> model.method1(**params) >> On Apr 16, 2013 7:49 PM, "jayhalleaux&qu

Re: SQLite3 database error!!!

2013-04-21 Thread Brad Pitcher
Can you post the rest of the traceback? On Apr 21, 2013 7:06 AM, "Kakar" wrote: > I am in settings.py and using SQLite3. But when i execute manage.py > syncdb, it gives me error: "Value error: Empty module name" I didn't > understood this part. Plz help me guyz. > > -- > You received this message

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-16 Thread Brad Pitcher
You need to do something like this before import django stuff: import os import sys sys.path.append(os.path.abspath(os.path.dirname(__file__))) os.environ['DJANGO_SETTINGS_MODULE'] = 'web.settings' - Brad Pitcher On Mon, Sep 16, 2013 at 8:19 AM, Nigel Legg wrote

Re: How do I create a standalone python application that uses the django environment (e.g. the ORM etc...)?

2013-09-17 Thread Brad Pitcher
th.abspath(os.path.dirname(__file__)), '..')) - Brad Pitcher On Tue, Sep 17, 2013 at 12:25 AM, DJ-Tom wrote: > > Hi, > > I'm also not sure if the python file is at the correct location. > > This is how the directory structure looks: > > my_

Re: Django hosting

2011-07-25 Thread Brad Montgomery
I've been using rackspace's Cloud servers. They give you a nice platform and charge only for what you use (so low-traffic sites end up being very affordable). However, you should play close attention to a service like https://gondor.io/ - it's an extremely easy-to-use service that makes host

Re: django-admin.py startproject not working

2010-12-12 Thread Brad Reardon
Vista is very picky about permissions. Try running the command prompt as an administrator. On Sun, Dec 12, 2010 at 8:06 PM, codegal wrote: > I'm trying to create my first Django project, and I must be missing > something really basic. I'm using Windows Vista, and have installed > Python 2.7 and

Re: django-admin.py startproject not working

2010-12-12 Thread Brad Reardon
umed, and neither the PYTHONPATH nor the environmental variables > path gets checked when Python runs the command, so this (full path to > django-admin.py) is what finally worked for me: > > python C:/Python27/Scripts/django-admin.py startproject mysite > > > On Dec 12, 8

Re: default_if_none as settings (??)

2010-12-13 Thread Brad Reardon
If I understand correctly, then the solution would be to do something of this sort: (pardon the formatting) if value: {{value}} else: {{default_value}} Something of that sort *should* work, although I am not entirely sure. On Mon, Dec 13, 2010 at 4:00 AM, PyMan wrote: > Maybe I'm wrong

Django Donations App

2011-02-25 Thread Brad Reardon
thing; instead of the name of the person that had donated that PayPal provides, I would like for them to be able to input an alias. Thanks! Brad Reardon -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

RedirectView()

2015-02-23 Thread Brad Rice
te display rather than Hello World. It isn't finding my Index(View) class for some reason. Can anybody explain to me how this should work? -- Brad Rice bradri...@gmail.com -- To succeed in life, you need two things: ignorance and confidence. -Mark Twain -- You received this message because y

Re: RedirectView()

2015-02-23 Thread Brad Rice
#x27;index'), url(r'^gallery', gallery, name='gallery'), ) On Monday, February 23, 2015 at 10:01:53 AM UTC-5, Andréas Kühne wrote: > > > 2015-02-23 15:30 GMT+01:00 Brad Rice >: > >> I'm using RedirectView and it is redirecting to my app, bu

Index(View) rendering template instead of view

2015-02-24 Thread Brad Rice
So I have a RedirectView.as_view() going to a page in an app called web. In the app web this is my view: class Index(View): def get(self, request, *args, **kwargs): return HttpResponse('Hello, World!') However, instead of showing that, when I get redirected to the app it shows my b

update a field of a related table on form save

2014-07-29 Thread Brad Rice
I have three tables. The first one is application which has a flag for if an app has been submitted as well as created date and modified date. The other two tables relate to the application table. I have two forms that get update those tables. What I want to do is update the application modified

Re: update a field of a related table on form save

2014-07-30 Thread Brad Rice
Thank you both for those suggestions. I got Tundebazby's to work as it was closest to what I was doing. I'll have to study the post_save some more. On Wednesday, July 30, 2014 2:33:57 AM UTC-4, Tundebabzy wrote: > > Hi Brad, my response is inline > > On 30 Jul 2014 02:2

crispy forms two forms and context

2014-09-01 Thread Brad Rice
This document seems to indicate I can have two forms inside one set of form tags: http://django-crispy-forms.readthedocs.org/en/latest/crispy_tag_forms.html#rendering-several-forms-with-helpers I cannot figure out how to set the context to be able to iterate over both forms. {% crispy form %}

Re: crispy forms two forms and context

2014-09-01 Thread Brad Rice
Schneider wrote: > > It looks like you are passing the context an actual Answers object, not a > Form or ModelForm object that will add/update an Answers object, hence > the reason the trace back complains about a lack of 'fields'. > > -James > > On Monday, Se

Re: crispy forms two forms and context

2014-09-02 Thread Brad Rice
ep in mind that only one of > the forms will be submitted (assuming each has it's own set of > tags). If you need to combine them and submit info for both, you may need > to roll a single custom form class that can handle all of the data, or > possibly look into Django formsets. >

try, except problem

2014-09-06 Thread Brad Rice
I'm trying to write a try: except: to check for three things. First I want to check if an application has already been filled out, thus, check for existence. Second if it has been filled out a flag that is is complete is set to true. Then the else would be neither of those things, they need to

Re: try, except problem

2014-09-06 Thread Brad Rice
Andréas that was it. I guess I wasn't thinking about that correctly. I sure appreciate the help. This Django group is a very good group. On Saturday, September 6, 2014 1:19:57 PM UTC-4, Andréas Kühne wrote: > > Hi Brad, > > 1. Why would app not be not be set if it is in

Re: Please help: urgent deployment problem with django post office

2014-10-03 Thread Brad Pitcher
If you want to simply disable logging, you could try setting the LOG_LEVEL to 0: POST_OFFICE = { 'LOG_LEVEL': 0 # Don't log anything } On Fri, Oct 3, 2014 at 4:55 AM, Sabine Maennel wrote: > Hello Collins, I need post office for other purposes not for error > logging. > > I worte an issue

Re: Alternative to fabric

2014-11-17 Thread Brad Pitcher
I agree Ansible is a good fit for your situation. Since Ansible works from yaml files, you don't have to write any Python 2.x compatible code as you would with Fabric. On Mon Nov 17 2014 at 8:24:24 AM Brian Schott wrote: > Ansible is a good choice. > > Sent from my iPhone > > On Nov 17, 2014, at

modelformst save

2014-12-05 Thread Brad Rice
For the life of me I can't figure out how to use a modelformset with class view. I get it to display but it won't save. Also, when it goes into form_invalid, it doesn't display the 3 formsets. Can anyone shed a little light? I'm using crispy forms with this in my template: {% crispy reference

CBV with inline formset

2014-12-15 Thread Brad Rice
I've pretty much butchered the code for 3 days now and cannot figure out how to insert an inline formset. Can anybody help me? I've tried to pare everything down to use two simple Models just to try to get an insert. I'm using django Author - Book relationship to keep it simple. class Author(m

Re: CBV with inline formset

2014-12-15 Thread Brad Rice
onse(self.get_context_data(formset=book_formset)) On Monday, December 15, 2014 4:09:29 PM UTC-5, Vijay Khemlani wrote: > > Try changing the name of the parameter in the url from author_id to pk > > On Mon, Dec 15, 2014 at 5:39 PM, Brad Rice > wrote: >> >> I've pre

control attributes on form fields in formset

2014-12-16 Thread Brad Rice
When I do a model form I can control the fields with attributes using name = forms.CharField(widget=forms.TextInput(attrs={'class':'u-full-width'})) How do I do something like that in an inline formset? I don't see where I can set attributes. -- You received this message because you are subs

Re: control attributes on form fields in formset

2014-12-16 Thread Brad Rice
Ah, found it on the django read the docs site. This is what I did in my inline formset factory BookFormset = inlineformset_factory(Author, Book, extra=3, max_num=3, widgets={'name': forms.TextInput(attrs={'class':'u-full-width'})}) On Tuesday, December 16, 20

Re: ANN: Django website redesign launched

2014-12-16 Thread Brad Rice
I noticed today when I went in to look something up. I like it. On Tuesday, December 16, 2014 11:12:54 AM UTC-5, Jannis Leidel wrote: > > Hi everyone, > > We're incredibly proud to share with you the new design of the Django > website, the documentation and the issue tracker. > > This is a long

Re: Recommendations for hosting service?

2015-01-06 Thread Brad Rice
I like webfaction, too. I think they would have all the stuff you list as well as more. On Tuesday, January 6, 2015 6:30:18 AM UTC-5, Bobby Mozumder wrote: > > Anyone have recommendations for hosting services that can do Django, > Node.js, Postgreqsl, python3, as well as PHP/MySQL for legacy stu

Class Based Views tutorials

2015-01-06 Thread Brad Rice
Does anyone have a recommendation for intermediate reading to understand Class Based Views? It seems most of the Django books were written when function based views were prevalent. I'm still having trouble understanding what the differences are between CreateView and UpdateView and what Meta is

Re: Class Based Views tutorials

2015-01-06 Thread Brad Rice
hlov > > On Tue, Jan 6, 2015 at 3:49 PM, Brad Rice > > wrote: > >> Does anyone have a recommendation for intermediate reading to understand >> Class Based Views? It seems most of the Django books were written when >> function based views were prevalent. I&#

Using admin views "outside" of admin

2013-11-20 Thread Brad Smith
ed to suck it up and rewrite everything from scratch using regular Django forms? Thanks to anyone who can offer some advice. --Brad -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving email

Re: Using admin views "outside" of admin

2013-11-21 Thread Brad Smith
glanceI don't see anything in the docs about replacing or extending the access control mechanism. Anyone have advice along those lines? Thanks again! --Brad On Wednesday, November 20, 2013 5:32:30 PM UTC-5, Gonzalo Delgado wrote: > > -BEGIN PGP SIGNED MESSAGE- > Ha

Re: Using admin views "outside" of admin

2013-11-21 Thread Brad Smith
for embedding, and then you'd just need some javascript to cause the submit button to use e.g. jQuery.post()... right? Any tips/warnings with regard to this? --Brad -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Admin permissions for proxy ModelAdmins?

2013-11-27 Thread Brad Smith
ndeed the more appropriate solution would be nice!). Thanks! --Brad -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googleg

saving to two models from one class view

2014-01-09 Thread Brad Rice
I have been banging around trying to write to two models from one view for a couple days and just cannot figure it out. I am using a CreateView. I want to write to a model with just the created_by user and a default value of False in app_complete to. I'm getting this error: [u'ManagementForm d

Re: saving to two models from one class view

2014-01-10 Thread Brad Rice
%} {{ form.as_p }} {{ application_form.management_form }} {{ application_form.non_form_errors }} {% endblock %} I'm really feeling the newbie moniker. On Friday, January 10, 2014 2:49:43 AM UTC-5, trojactory wrote:

Re: How to edit a model with an inline formset

2014-01-10 Thread Brad Rice
I'm following that blog entry, too, and getting an error when I try to save: [u'ManagementForm data is missing or has been tampered with'] On Thursday, January 9, 2014 11:57:37 AM UTC-5, Cody Scott wrote: > > I am trying to create a model with an inline formset. I followed the guide > here > ht

using success_url

2014-01-10 Thread Brad Rice
I can't seem to find success using success_url If I try this in my urls.py file url(r'^step2/', AnswersCreate.as_view(success_url='/requestform/success'), name='answers'), and then in my view: def form_valid(self, form): obj = form.save(commit=False) obj.created_by = self.reque

NoReverseMatch error on redirect

2014-01-13 Thread Brad Rice
I have a mulit-page form I am building. I get the start page to enter the data for the application, validate and save. When I try using reverse to move to the next page I get this error: NoReverseMatch at /requestform/start/Reverse for 'registrant_add' with arguments '()' and keyword arguments

Re: NoReverseMatch error on redirect

2014-01-14 Thread Brad Rice
I figured it out. I had a namespaced url so it needed: return HttpResponseRedirect(reverse('requestform:registrant_add', kwargs={'app_id': obj.id})) On Monday, January 13, 2014 12:22:59 PM UTC-5, Brad Rice wrote: > > I have a mulit-page form I am building. I get t

Save to User table first_name and last_name from a page with a different form

2014-01-22 Thread Brad Rice
I have a registration and login page that only takes username and password. After they register or login, they are taken to a profile form where they can provide additional information such as address and phone numbers. I'm using a Model Form CreateView there. On that page I want the First Name

Re: Save to User table first_name and last_name from a page with a different form

2014-01-22 Thread Brad Rice
plication_id})) On Wednesday, January 22, 2014 9:48:27 AM UTC-5, Brad Rice wrote: > > I have a registration and login page that only takes username and > password. After they register or login, they are taken to a profile form > where they can provide additional information such as addre

Re: Do you think Django's future is threatened by JS frameworks in both client & server?

2014-01-27 Thread Brad Moore
The tech giants are pushing JavaScript more than Python these days. JavaScript is said to be the future language for enterprise applications. I think Python will be around but will play a third place role behind JavaScript and PHP. Yes, I said PHP and I apologize but its true just look at the

Re: Printing things to the server console in Django?

2014-02-21 Thread Brad Pitcher
print("information") - Brad Pitcher On Fri, Feb 21, 2014 at 1:00 PM, wasingej wrote: > Hi guys. I'm pretty new to Django and I'm trying to figure out how I can > print out information to my console that I started my web application on > using "pytho

validate answers from a detail view

2014-04-12 Thread Brad Rice
I'm using a Class based Generic Detail View to show end users their answers to previous mulit-page forms. How can I use that final detail view to validate the answers? Should I not be using a Detail view or can I somehow do a conditional get to the next view based upon those answers? Right now I

Re: validate answers from a detail view

2014-04-14 Thread Brad Rice
pen on this exact feature > > https://code.djangoproject.com/ticket/21644 > > > > Em sábado, 12 de abril de 2014 14h28min01s UTC-3, Brad Rice escreveu: > >> I'm using a Class based Generic Detail View to show end users their >> answers to previous mulit-page for

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-02 Thread Brad Pitcher
=/data/app/guillem-py3-dj17-test/lib64/python3.3/site-packages/ - Brad Pitcher On Fri, May 2, 2014 at 4:11 AM, Guillem Liarte < guillem.lia...@googlemail.com> wrote: > Hello, > > I have looked through the web in several different especialised forums but > I cannot find

Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Brad Pitcher
django.contrib.markup has been deprecated. You could try using the standalone project that is a copy of the same code from django: pip install django_markup_deprecated Then add "markup_deprecated" to your INSTALLED_APPS instead of django.contrib.markup. - Brad Pitcher On

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-05 Thread Brad Pitcher
It's just something that was passed down to me from a senior programmer :-) - Brad Pitcher On Mon, May 5, 2014 at 2:45 PM, Guillem Liarte < guillem.lia...@googlemail.com> wrote: > Hello Brad, > > Thanks for the suggestion, I was suspecting something like that. I wil

Re: 1.6.5 as a zip for download?

2014-05-28 Thread Brad Pitcher
Is this what you're looking for? https://github.com/django/django/archive/1.6.5.zip On Wed, May 28, 2014 at 9:51 AM, Neil Walker wrote: > Hello, > I wish to download 1.6.5 stable zip without using pip and not as a tar/gz > (limitations on software I can use at work), but when I visit the downlo

change display value of filter in admin

2016-05-31 Thread Brad Rice
I have a field that has two values set "S" or "E". I use it to filter records in the admin. I would like the values in the filter to be spelled out as "Signature" and "Emerging". How do I have it show like that in Admin? This is my filter: list_filter = ('app_complete', 'app_type') app_type

Re: Make mobile app from webapp

2019-01-07 Thread Brad Pitcher
The basic formula we've used in the past: 1. Decouple back- and front-end using API 2. Use django-bakery (https://django-bakery.readthedocs.io/en/latest/) to export the needed pages to HTML (requires the use of class-based views, which are actually really awesome) 3. Use Phonegap to wrap these HTML

mod_wsgi picking up wrong settings

2019-05-14 Thread Brad Rice
I have multiple websites setup on a linode cloud. I am using Virtual Host containers with WSGI paths and Virtual Envs for each app. When I set any of the apps to Debug = False, they throw 500 errors. It appears they are using the same wsgi environment settings because the error is ALLOWED_HOSTS

Setting a crispy form label from a db model field

2016-01-15 Thread Brad Rice
I'm using Crispy forms for an app that I created. I want to have the labels for the form come from a db entry. Is there a way, and how would you set the label using a model-view variable? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

Re: issue in hosting https://www.pythonanywhere.com

2018-12-24 Thread Brad Pitcher
The paths in your logs indicate you aren't using a virtualenv. Find the virtualenv section in the web tab and make sure you specify the path to your virtualenv there. Should be something like /home/[username]/.virtualenvs/djangoVenv On Mon, Dec 24, 2018 at 8:09 AM Atul Anand wrote: > I am using

Re: issue in hosting https://www.pythonanywhere.com

2018-12-25 Thread Brad Pitcher
you activate it? >> Sincerely yours, >> >> Joel G Mathew >> >> >> >> On Tue, 25 Dec 2018 at 12:27, Atul Anand >> wrote: >> >>> Hi Brad, >>> >>> Thanks for helping, but I am using a venv. >>> please find the bel

Re: issue in hosting https://www.pythonanywhere.com

2018-12-25 Thread Brad Pitcher
, Dec 25, 2018 at 7:58 AM Brad Pitcher wrote: > Can you share your wsgi file created on pythonanywhere? > > On Tue, Dec 25, 2018, 1:01 AM Atul Anand >> Hi >> I have activated the venv by below cmd: >> 07:57 ~/simplesocial (master)$ workon djangoVenv >> Please let

Replicating complex query with two dense_rank() functions using ORM

2020-11-03 Thread Brad Buran
I have a "puzzle of the day" that users can answer. I track the puzzle of the day using the Puzzle model. I track the answers using the PuzzleAnswer model. I would like to calculate the number of consecutive puzzles a particular user (i.e., the author) gets right in a row. The current SQL I use

Sending unsafe requests from web extension to DRF - cannot send Referer

2021-09-30 Thread Brad Solomon
We have a web extension using Chrome Manifest V3 , which talks with a backend web service written with Django (3.2) / Django Rest Framework, and served with Gunicorn/Nginx. After turning on HTTPS, we are no longer to successfully make uns

django.core.exceptions.ImproperlyConfigured DJANGO_SETTINGS_MODULE

2019-09-18 Thread Brad S
I am trying to get a new server up and running and I am make a n00b error somewhere. django.core.exceptions.ImproperlyConfigured: Requested setting MIDDLEWARE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure()

Django formset, forms passing unique choices into a choicefield for each form

2019-12-18 Thread Brad Allgood
Initially posted on stack overflow: https://stackoverflow.com/questions/59395761/passing-dynamic-choices-into-a-formset-unique-for-each-form I am working on what I thought was a simple college football confidence pool. The concept is as follows: - Bowl Model: Model that stores information of

<    1   2