Re: Canvas OAuth2 From Django View

2015-06-29 Thread Henry Versemann
tps:///login/oauth2/token', { > 'code': code, 'client_id': 'etc'} > access_code = r.json()['access_code'] > return HttpResponse('Successfully Logged in! Here's your access_code: > %s' % access_code) > > Collin > > On Sunday, January 18, 2015 at 7:01:12 PM UTC-5,

Trying to do a 'return redirect' from one view to another (python 2.7.8, django1.7)

2015-06-24 Thread Henry Versemann
Here's an abbreviated look at some code I have: @receiver(data_required) def StartProcessView(sender, **kwargs): #print 'StartProcessView ENTERED !...' try: request = kwargs.get('request') postcopy = request.POST.copy() print'\n StartProcessView - THE "postcopy"

Trying to Build File Upload using jQuery dialog (jQuery 1.10.2/django 1.7/Python 2.7.8)

2015-05-29 Thread Henry Versemann
I'm constructing my file-upload dialog using jquery(jq)/javascript/html where the file-upload is supposed to begin like this: htmlStr = 'SELECT FILE TO UPLOAD:'; jq("#upldfildialog").append(htmlStr); Everything seems to work except for actually being able to capture the file

Re: Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Henry Versemann
en/1.7/topics/http/sessions/ > > def view_1(self, request): > request.session['display_key_list_updated'] = True > > def view_2(self, request): > if request.session.get('display_key_list_updated'): > do_something() > > _Nik > > On 5/13/2015 2:13 PM, Henr

Global Variable Neded? - Python 2.7.8 / Django 1.7

2015-05-13 Thread Henry Versemann
I have a list of one or more items being returned back to my application as a response from a call to an API. In this particular part of the process depending on the data keys selected by the user, if any some data fields will be formatted automatically. When that happens I need to add the keys

Queryset/order_by option sort keys string manipulation

2015-04-16 Thread Henry Versemann
I have a string of sort keys which I've generated dynamically using the name of the table (model) that I'm trying to retrieve elements from, while putting them in a pre-determined sort order. The original sort key string looks like this:

Re: Trying to avoid using the "eval" command/statement

2015-04-15 Thread Henry Versemann
ok. On Wednesday, April 15, 2015 at 3:39:26 PM UTC-5, Vijay Khemlani wrote: > > tblEntryObj seems to be an instance of your model, it is not a dictionary, > so normally it wouldn't have a "keys" method. > > On Wed, Apr 15, 2015 at 5:32 PM, Henry Versemann <f

Re: Trying to avoid using the "eval" command/statement

2015-04-15 Thread Henry Versemann
Khemlani wrote: > You can use get_model > > from django.db.models.loading import get_model > > YourModel = get_model('your_app', tableName) > > On Wed, Apr 15, 2015 at 2:01 PM, Tim Chase <django...@tim.thechases.com > > wrote: > >> On 2015-04-15 09:45,

Re: Trying to avoid using the "eval" command/statement

2015-04-15 Thread Henry Versemann
from using getattr() on the module. > > > > > http://stackoverflow.com/questions/10773348/get-python-class-object-from-string > > > > > > > > > On Wed, Apr 15, 2015 at 11:45 AM, Henry Versemann <fence...@gmail.com > > wrote: > >

Trying to avoid using the "eval" command/statement

2015-04-15 Thread Henry Versemann
I have an incoming list of DB table names associated with my application. I want to iterate through this list of table names getting all of the entries for each table and then print some data from each tables' entry to a file. I've tried to write this so I can use it for as many app-associated

Python csv Module ValueError Exception

2015-04-13 Thread Henry Versemann
Up till now I've had no problems using the Python 2.7.8 csv module to write to Python dictionary objects to a csv file, using the csv.DictWriter, however now it appears that I'm sending it an object that it can't handle (See the attached file for an edited/readable version of the python object

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-12 Thread Henry Versemann
en't shown. If the problem were where you're concentrating, > you would have found it. Please expand the scope of what you're showing. > > On Mon, Mar 9, 2015 at 3:35 PM, Henry Versemann <fence...@gmail.com > > wrote: > >> OK here goes. The logic in the routine which I actu

Re: Using the eval() command

2015-03-11 Thread Henry Versemann
Carl, Thanks for the advice and information. I'm certainly going to try it. Thanks again for the help. Henry On Wednesday, March 11, 2015 at 11:05:38 AM UTC-5, Carl Meyer wrote: > Hi Henry, > > On 03/10/2015 07:37 PM, Henry Versemann wrote: > > So how does an expression lik

Re: Using the eval() command

2015-03-10 Thread Henry Versemann
which would be automatically executed to produce a result. Please explain or point me to some documentation explaining this type of code or coding. Thanks. Henry On Tuesday, March 10, 2015 at 4:49:48 PM UTC-5, Carl Meyer wrote: > Hi Henry, > > On 03/10/2015 03:25 PM, Henry Versem

Re: Using the eval() command

2015-03-10 Thread Henry Versemann
> statement. > > Why wouldn't you just say: > > innerDict['+newinnrkey+'] = newinnrval > > > On Tue, Mar 10, 2015 at 5:25 PM, Henry Versemann <fence...@gmail.com > > wrote: > >> I have a new dictionary that I want to build, using data from another >&

Using the eval() command

2015-03-10 Thread Henry Versemann
I have a new dictionary that I want to build, using data from another dictionary. I have a view which is receiving a single key/value pair from the original dictionary. Then in the view I've defined the new dictionary like this: innerDict = {} Now I want to make this as dynamic as possible

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-09 Thread Henry Versemann
n to > allow someone to spot the problem. If you post the code that is performing > the modification, someone may be able to spot the issue. > > On Mon, Mar 9, 2015 at 1:50 PM, Henry Versemann <fence...@gmail.com > > wrote: > >> Yes Id did do that. The problems I seem to b

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-09 Thread Henry Versemann
you haven't provided enough information to > allow someone to spot the problem. If you post the code that is performing > the modification, someone may be able to spot the issue. > > On Mon, Mar 9, 2015 at 1:50 PM, Henry Versemann <fence...@gmail.com > > wrote: > >> Y

Re: How to modify and then recombine json response data without breaking json formatting

2015-03-09 Thread Henry Versemann
by the javascript on the client side. Thanks. Henry On Monday, March 9, 2015 at 12:42:23 PM UTC-5, ke1g wrote: > Did you remember to set the content type of your response to > application/json? > > On Mon, Mar 9, 2015 at 1:18 PM, Henry Versemann <fence...@gmail.com > > wrote: &

How to modify and then recombine json response data without breaking json formatting

2015-03-09 Thread Henry Versemann
First to be clear up front let me say that I'm using Django1.7, Python 2.7.8, and the requests (Requests: HTTP for Humans ) library version2.4.3 to build the application mentioned below. I have an application which needs to

Re: Complex Querys And Results Response Processing/Formatting

2015-03-03 Thread Henry Versemann
matting/serializing the data as JSON yourself? > Or are you serializing it into JSON using the usual Django methods? > > > > Beyond that, what errors are you seeing and where? > > > -James > > > On Mon, Mar 2, 2015 at 10:56 AM, Henry Versemann <fence...@gmail.com

Complex Querys And Results Response Processing/Formatting

2015-03-02 Thread Henry Versemann
I'm trying to submit a series of ajax requests from some server code. When I get a response back from each request I'm trying to add that response to a list. Once all of the requests have been sent and all of their responses received and added to the list, then I want to send the final list

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-07 Thread Henry Versemann
t 9:39:00 AM UTC-8, Henry Versemann wrote: >> >> Scot, Thanks for the reply. OK I've gotten down to the point to where I >> have my version of your json_data in your code below, but I'm not sure I >> understand exactly what your code is doing, after you have the json_data &g

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Henry Versemann
Thanks Larry. On Thursday, February 5, 2015 at 1:17:37 PM UTC-6, larry@gmail.com wrote: > > On Thu, Feb 5, 2015 at 2:10 PM, Henry Versemann <fence...@gmail.com > > wrote: > > I have a django view (django v. 1.7 ; python v. 2.7.8) which currently > and > >

Re: how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-06 Thread Henry Versemann
from this is an "exceptions.AttributeError". Thanks again for the help. On Friday, February 6, 2015 at 9:54:03 AM UTC-6, Scot Hacker wrote: > On Thursday, February 5, 2015 at 11:10:32 AM UTC-8, Henry Versemann wrote: >> >> I have a django view (django v. 1.7 ; python

how to access json data value(s) returned back to django view from 'GET' request to an api

2015-02-05 Thread Henry Versemann
I have a django view (django v. 1.7 ; python v. 2.7.8) which currently and successfully sends a request to an api, and receives a good response back. I'm sending and receiving using the 'requests' library (v. 2.4.3). Now in addition to sending the raw response data back in an HttpResponse I

Re: Canvas OAuth2 From Django View

2015-01-18 Thread Henry Versemann
Sergiy, Yes it is. Thanks. Henry On Saturday, January 17, 2015 at 10:36:06 AM UTC-6, Sergiy Khohlov wrote: > > Is CRFS protection enabled ? > 15 січ. 2015 18:51, користувач "Henry Versemann" <fence...@gmail.com > > написав: > >> First let me say that I ha

Re: Canvas OAuth2 From Django View

2015-01-18 Thread Henry Versemann
://docs.python.org/3/library/urllib.request.html > https://docs.python.org/2/library/urllib2.html > > or install requests, which is friendlier: > http://docs.python-requests.org/en/latest/ > > Collin > > On Thursday, January 15, 2015 at 11:51:45 AM UTC-5, Henry Versemann

Canvas OAuth2 From Django View

2015-01-15 Thread Henry Versemann
First let me say that I haven't done a lot of stuff with either Python or Django, but I think I understand most of the basics. I am trying to get an access token back from the OAuth2 Web Application Flow of the Canvas' LMS API ( https://canvas.instructure.com/doc/api/file.oauth.html ). I have

Re: Django - trying to access User model column field from a view

2015-01-06 Thread Henry Versemann
he output of 'print userobj' is controlled by the __str__() method of the > User model (inherited from AbstractBaseUser), and only returns the > username. I showed a couple of different ways to enumerate the attributes > and methods available on a User object via a for loop using the

Re: Django - trying to access User model column field from a view

2015-01-06 Thread Henry Versemann
way? Thanks for the help. On Tuesday, January 6, 2015 1:18:57 PM UTC-6, Tundebabzy wrote: > userobj = User.objects.get(username=myuser) > > Will get you a User object or throw an error if it can't find anything. > The string representation of the User object is the string contained it

Django - trying to access User model column field from a view

2015-01-06 Thread Henry Versemann
I currently using Python 2.7.7 and Django 1.7 as I build a new application. I need to retrieve an entire User object from the authentication User Model, but when I do the following: userobj = User.objects.get(username=myuser) all I'm getting returned is just the same username value (contained

RE: Documentation Checked But Unclear: How to supress form.errors from views when needed?

2011-04-04 Thread Henry Versemann
Yes. First thanks for the response. I'm doing some experimenting with the forms and well as the requests and possibly reusing them as much as possible, and one thing I thought I'd try was to reuse values from a previous screen which some of the same fields names and types, so that when the new