[google-appengine] python and gae newbie: init or the like?

2012-09-19 Thread Jason Andrea

i have a controller file with multiple methods.  in each method i am 
calling another method ("start") that sets up some basic variables for use 
by various template files for that controller/method.  Currently i am 
calling self.start() in each method, but I know there must be a better way 
to do it, but can't figure it out.  I was thinking Init, but not sure.

class SiteController(BaseController):
def method1(self):
  self.start()
# get all table1 info about selected site
dataAccess.cursor.execute("select * FROM table1")
self.siteTab1 = dataAccess.cursor.fetchall()
def method2(self):
self.start()
# get all table2 info about selected site
dataAccess.cursor.execute("select * FROM table2")
self.siteTab2 = dataAccess.cursor.fetchall()
def start(self):
# setup for variables used by all methods
dataAccess.cursor.execute("select * FROM Menu")
self.siteMainMenu = dataAccess.cursor.fetchall()

Thanks for any tips

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/esI1VywnVysJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



[google-appengine] Google Cloud MySql Data Console Changes: Viewing and Querying Data

2015-07-07 Thread Jason Andrea
So, one of the reasons i only developed 1 or 2 apps using GAE was because i 
was unhappy with the console interfaces (aside from all of the other tools 
required to even get started) and the time it takes to learn them, get 
comfortable with them etc... and back when i created my 1 or 2 apps, the 
consoles, menus, etc... seemed to change ever few weeks. Granted, this was 
a few years ago.  But now i have to do some data maintenance on one of my 
GAE websites that, thankfully, is still working just fine. I have a Cloud 
MySql database behind my website. People can register information about 
their businesses, etc... and have other people on the web search it. All is 
working fine, but now i need to simply dump the data in the MySql db AND 
make a small change to one of the fields in a MySql table.

Back before i abandoned GAE, i could easily go to 
https://appengine.google.com, find the data viewing console and type in 
queries, and actually SEE my MySql data behind my site. Now... my old 
documentation is completely defunct, with links all redirecting to new 
locations, because the google console interfaces have changed so 
drastically since I was last on the site, and i can't seem to find anything 
even remotely close to a console screen where i can select the database i 
want to query (like in the old days) and type into a text box to run some 
queries or update my schema.

Basically... i know my data is there because people are adding to it every 
day... and the data is findable on the website itself, but i can't for the 
life of me find a way to connect/view my data on 
the https://appengine.google.com or https://console.developers.google.com 
sites. Does anybody have any advice?

In my Python app settings.py code I have my:
GOOGLE_APPINSTANCE_NAME
GOOGLE_DATABASE_NAME

I'm also wondering if i can connect to this data via my desktop Navicat 
MySql client.

Do i really have to do all 
this? https://cloud.google.com/sql/docs/mysql-client

And do I have to create a MySql instance/IP if I alerady HAVE a MySql 
instance running out on GAE? My website is obviously using the MySql data 
behind it from when i first built the site. Why can I not find my MySql 
data via the Google Console(s)?


-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/0a9516f2-c73a-4add-95be-eeafb7388ed9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Google Cloud MySql Data Console Changes: Viewing and Querying Data

2015-07-08 Thread Jason Andrea
Very helpful... thank you for your help!

So i've:
-created a new user/password to access my instance
-authorized my computer's IP to access the instance
-found the IPv6 IP address for my instance

I've plugged all of these into my usual GUI MySql client Navicat and it 
gives me this error when trying to connect:
'Unknown MySql server host '[my IPv6 IP]' (10051)

I've also tried to connect from the >mysql command line prompt using 
instructions i found... but i get the same connection error.

I assume the port is 3306.



On Wednesday, July 8, 2015 at 9:10:30 AM UTC-5, Ryan (Cloud Platform 
Support) wrote:
>
> Salutations Jason,
>
> You cannot currently access your data through the console. You can file a 
> Feature 
> Request 
> <https://code.google.com/p/googleappengine/issues/entry?template=Feature%20request>
>  
> to get that functionality added.
>
> There might be some confusion with how to connect. You can use what ever 
> client <https://cloud.google.com/sql/docs/external> you want. If you 
> already have an IP address for the instance you don't need a new one. You 
> need to add the IP address of the computer you are connecting from to the 
> whitelist.
>
> You can access the interface to look up the IP and whitelist by going here 
> <https://console.developers.google.com/project/_/sql/instances>, 
> selecting your instance -> Access Control 
>
> -> Authorization -> Allowed Networks: to add your computers IP
> -> IP address: to get the IP of your CloudSQL.
>
> On Tuesday, July 7, 2015 at 4:48:21 PM UTC-4, Jason Andrea wrote:
>>
>> So, one of the reasons i only developed 1 or 2 apps using GAE was because 
>> i was unhappy with the console interfaces (aside from all of the other 
>> tools required to even get started) and the time it takes to learn them, 
>> get comfortable with them etc... and back when i created my 1 or 2 apps, 
>> the consoles, menus, etc... seemed to change ever few weeks. Granted, this 
>> was a few years ago.  But now i have to do some data maintenance on one of 
>> my GAE websites that, thankfully, is still working just fine. I have a 
>> Cloud MySql database behind my website. People can register information 
>> about their businesses, etc... and have other people on the web search it. 
>> All is working fine, but now i need to simply dump the data in the MySql db 
>> AND make a small change to one of the fields in a MySql table.
>>
>> Back before i abandoned GAE, i could easily go to 
>> https://appengine.google.com, find the data viewing console and type in 
>> queries, and actually SEE my MySql data behind my site. Now... my old 
>> documentation is completely defunct, with links all redirecting to new 
>> locations, because the google console interfaces have changed so 
>> drastically since I was last on the site, and i can't seem to find anything 
>> even remotely close to a console screen where i can select the database i 
>> want to query (like in the old days) and type into a text box to run some 
>> queries or update my schema.
>>
>> Basically... i know my data is there because people are adding to it 
>> every day... and the data is findable on the website itself, but i can't 
>> for the life of me find a way to connect/view my data on the 
>> https://appengine.google.com or https://console.developers.google.com 
>> sites. Does anybody have any advice?
>>
>> In my Python app settings.py code I have my:
>> GOOGLE_APPINSTANCE_NAME
>> GOOGLE_DATABASE_NAME
>>
>> I'm also wondering if i can connect to this data via my desktop Navicat 
>> MySql client.
>>
>> Do i really have to do all this? 
>> https://cloud.google.com/sql/docs/mysql-client
>>
>> And do I have to create a MySql instance/IP if I alerady HAVE a MySql 
>> instance running out on GAE? My website is obviously using the MySql data 
>> behind it from when i first built the site. Why can I not find my MySql 
>> data via the Google Console(s)?
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/e17da4c5-68e5-4f7f-aa06-f42404541a35%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Google Cloud MySql Data Console Changes: Viewing and Querying Data

2015-07-08 Thread Jason Andrea
a yes. it is IPv4. So now I've had Google generate an IPv4 IP 
'allowable IP' for me... which makes perfect sense. I've updated all of my 
connection info with the new IPv4 IP that Google assigned me. But still not 
connecting. But now it is taking much longer before it gives me basically 
the same error.

I wish i could see my database show up somewhere on one of Google's 
consoles. This whole thing is just odd to me. I'm looking at my project, 
and looking at the "databases" tab, but it doesn't list any databases (see 
attached screen shot).

Even when i simply try to "Export" my data using the export button at the 
top it always throws an error because it can't find the database. 

Here is my python code:
#google cloud sql database connection info
#production database
GOOGLE_DATABASE="shpotrades"

I can't even get confirmation from Google that I actually DO have a 
database named 'shpotrades'. Yet my site is working and showing the data. 
Lord God Google WHERE IS MY DATA? :)

Thanks for your help, Ryan... you are the man.



On Wednesday, July 8, 2015 at 12:13:57 PM UTC-5, Ryan (Cloud Platform 
Support) wrote:
>
> The IP address for your PC that you authorised. Is it a IPv4 or IPv6 
> address?
>
> On Tuesday, July 7, 2015 at 4:48:21 PM UTC-4, Jason Andrea wrote:
>>
>> So, one of the reasons i only developed 1 or 2 apps using GAE was because 
>> i was unhappy with the console interfaces (aside from all of the other 
>> tools required to even get started) and the time it takes to learn them, 
>> get comfortable with them etc... and back when i created my 1 or 2 apps, 
>> the consoles, menus, etc... seemed to change ever few weeks. Granted, this 
>> was a few years ago.  But now i have to do some data maintenance on one of 
>> my GAE websites that, thankfully, is still working just fine. I have a 
>> Cloud MySql database behind my website. People can register information 
>> about their businesses, etc... and have other people on the web search it. 
>> All is working fine, but now i need to simply dump the data in the MySql db 
>> AND make a small change to one of the fields in a MySql table.
>>
>> Back before i abandoned GAE, i could easily go to 
>> https://appengine.google.com, find the data viewing console and type in 
>> queries, and actually SEE my MySql data behind my site. Now... my old 
>> documentation is completely defunct, with links all redirecting to new 
>> locations, because the google console interfaces have changed so 
>> drastically since I was last on the site, and i can't seem to find anything 
>> even remotely close to a console screen where i can select the database i 
>> want to query (like in the old days) and type into a text box to run some 
>> queries or update my schema.
>>
>> Basically... i know my data is there because people are adding to it 
>> every day... and the data is findable on the website itself, but i can't 
>> for the life of me find a way to connect/view my data on the 
>> https://appengine.google.com or https://console.developers.google.com 
>> sites. Does anybody have any advice?
>>
>> In my Python app settings.py code I have my:
>> GOOGLE_APPINSTANCE_NAME
>> GOOGLE_DATABASE_NAME
>>
>> I'm also wondering if i can connect to this data via my desktop Navicat 
>> MySql client.
>>
>> Do i really have to do all this? 
>> https://cloud.google.com/sql/docs/mysql-client
>>
>> And do I have to create a MySql instance/IP if I alerady HAVE a MySql 
>> instance running out on GAE? My website is obviously using the MySql data 
>> behind it from when i first built the site. Why can I not find my MySql 
>> data via the Google Console(s)?
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/a564e1aa-f58d-46b7-ba25-2c0a59a88928%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[google-appengine] Re: Google Cloud MySql Data Console Changes: Viewing and Querying Data

2015-07-08 Thread Jason Andrea
I was able to get my database structure edits, etc... done by creating some 
extra 'tool' type queries in my python website app and re-deploying, so no 
worries. basically i just used my website app to do the things i was hoping 
to do with a mysql client... but oh well.

On Wednesday, July 8, 2015 at 1:04:11 PM UTC-5, Jason Andrea wrote:
>
> a yes. it is IPv4. So now I've had Google generate an IPv4 IP 
> 'allowable IP' for me... which makes perfect sense. I've updated all of my 
> connection info with the new IPv4 IP that Google assigned me. But still not 
> connecting. But now it is taking much longer before it gives me basically 
> the same error.
>
> I wish i could see my database show up somewhere on one of Google's 
> consoles. This whole thing is just odd to me. I'm looking at my project, 
> and looking at the "databases" tab, but it doesn't list any databases (see 
> attached screen shot).
>
> Even when i simply try to "Export" my data using the export button at the 
> top it always throws an error because it can't find the database. 
>
> Here is my python code:
> #google cloud sql database connection info
> #production database
> GOOGLE_DATABASE="shpotrades"
>
> I can't even get confirmation from Google that I actually DO have a 
> database named 'shpotrades'. Yet my site is working and showing the data. 
> Lord God Google WHERE IS MY DATA? :)
>
> Thanks for your help, Ryan... you are the man.
>
>
>
> On Wednesday, July 8, 2015 at 12:13:57 PM UTC-5, Ryan (Cloud Platform 
> Support) wrote:
>>
>> The IP address for your PC that you authorised. Is it a IPv4 or IPv6 
>> address?
>>
>> On Tuesday, July 7, 2015 at 4:48:21 PM UTC-4, Jason Andrea wrote:
>>>
>>> So, one of the reasons i only developed 1 or 2 apps using GAE was 
>>> because i was unhappy with the console interfaces (aside from all of the 
>>> other tools required to even get started) and the time it takes to learn 
>>> them, get comfortable with them etc... and back when i created my 1 or 2 
>>> apps, the consoles, menus, etc... seemed to change ever few weeks. Granted, 
>>> this was a few years ago.  But now i have to do some data maintenance on 
>>> one of my GAE websites that, thankfully, is still working just fine. I have 
>>> a Cloud MySql database behind my website. People can register information 
>>> about their businesses, etc... and have other people on the web search it. 
>>> All is working fine, but now i need to simply dump the data in the MySql db 
>>> AND make a small change to one of the fields in a MySql table.
>>>
>>> Back before i abandoned GAE, i could easily go to 
>>> https://appengine.google.com, find the data viewing console and type in 
>>> queries, and actually SEE my MySql data behind my site. Now... my old 
>>> documentation is completely defunct, with links all redirecting to new 
>>> locations, because the google console interfaces have changed so 
>>> drastically since I was last on the site, and i can't seem to find anything 
>>> even remotely close to a console screen where i can select the database i 
>>> want to query (like in the old days) and type into a text box to run some 
>>> queries or update my schema.
>>>
>>> Basically... i know my data is there because people are adding to it 
>>> every day... and the data is findable on the website itself, but i can't 
>>> for the life of me find a way to connect/view my data on the 
>>> https://appengine.google.com or https://console.developers.google.com 
>>> sites. Does anybody have any advice?
>>>
>>> In my Python app settings.py code I have my:
>>> GOOGLE_APPINSTANCE_NAME
>>> GOOGLE_DATABASE_NAME
>>>
>>> I'm also wondering if i can connect to this data via my desktop Navicat 
>>> MySql client.
>>>
>>> Do i really have to do all this? 
>>> https://cloud.google.com/sql/docs/mysql-client
>>>
>>> And do I have to create a MySql instance/IP if I alerady HAVE a MySql 
>>> instance running out on GAE? My website is obviously using the MySql data 
>>> behind it from when i first built the site. Why can I not find my MySql 
>>> data via the Google Console(s)?
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/1b2562b0-aace-4cb4-b38c-7873c139393d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [google-appengine] Re: Google Cloud MySql Data Console Changes: Viewing and Querying Data

2015-07-09 Thread Jason Andrea
Oops... got busy and i never did submit it until just now.

https://code.google.com/p/googleappengine/issues/detail?id=12133


On Thu, Jul 9, 2015 at 8:55 AM, Ryan (Cloud Platform Support) <
rbruy...@google.com> wrote:

> Mp, what is the link to your Feature Request?
>
> On Wednesday, July 8, 2015 at 9:51:13 PM UTC-4, Jason Andrea wrote:
>>
>> Done. And thanks again!
>>
>>
>>
>> On Jul 8, 2015, at 3:27 PM, Ryan (Cloud Platform Support) <
>> rbruy...@google.com> wrote:
>>
>> I'm glad you were able to get your work done. Please file a Feature
>> Request
>> <https://code.google.com/p/googleappengine/issues/entry?template=Feature%20request>
>> to add what you need to the console. I will process it personally if you do.
>>
>> On Tuesday, July 7, 2015 at 4:48:21 PM UTC-4, Jason Andrea wrote:
>>>
>>> So, one of the reasons i only developed 1 or 2 apps using GAE was
>>> because i was unhappy with the console interfaces (aside from all of the
>>> other tools required to even get started) and the time it takes to learn
>>> them, get comfortable with them etc... and back when i created my 1 or 2
>>> apps, the consoles, menus, etc... seemed to change ever few weeks. Granted,
>>> this was a few years ago.  But now i have to do some data maintenance on
>>> one of my GAE websites that, thankfully, is still working just fine. I have
>>> a Cloud MySql database behind my website. People can register information
>>> about their businesses, etc... and have other people on the web search it.
>>> All is working fine, but now i need to simply dump the data in the MySql db
>>> AND make a small change to one of the fields in a MySql table.
>>>
>>> Back before i abandoned GAE, i could easily go to
>>> https://appengine.google.com, find the data viewing console and type in
>>> queries, and actually SEE my MySql data behind my site. Now... my old
>>> documentation is completely defunct, with links all redirecting to new
>>> locations, because the google console interfaces have changed so
>>> drastically since I was last on the site, and i can't seem to find anything
>>> even remotely close to a console screen where i can select the database i
>>> want to query (like in the old days) and type into a text box to run some
>>> queries or update my schema.
>>>
>>> Basically... i know my data is there because people are adding to it
>>> every day... and the data is findable on the website itself, but i can't
>>> for the life of me find a way to connect/view my data on the
>>> https://appengine.google.com or https://console.developers.google.com
>>> sites. Does anybody have any advice?
>>>
>>> In my Python app settings.py code I have my:
>>> GOOGLE_APPINSTANCE_NAME
>>> GOOGLE_DATABASE_NAME
>>>
>>> I'm also wondering if i can connect to this data via my desktop Navicat
>>> MySql client.
>>>
>>> Do i really have to do all this?
>>> https://cloud.google.com/sql/docs/mysql-client
>>>
>>> And do I have to create a MySql instance/IP if I alerady HAVE a MySql
>>> instance running out on GAE? My website is obviously using the MySql data
>>> behind it from when i first built the site. Why can I not find my MySql
>>> data via the Google Console(s)?
>>>
>>>
>>>  --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "Google App Engine" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/google-appengine/rZ4cXIyG4Cw/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to
>> google-appengine+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-appengine@googlegroups.com.
>> Visit this group at http://groups.google.com/group/google-appengine.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-appengine/48e7d74a-b9d6-4682-acf6-cd1e4241240e%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-appengine/48e7d74a-b9d6-4682-acf6-cd1e4241240e%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google App Engine" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-appengine/rZ4cXIyG4Cw/unsubscribe
> .
> To