hello one and all,
this is not a web2py question or issue. but, since many are python
experts, i thought i'd ask.
are there any other ways to import a module or package other then the
"import" or "from...import..." statements? i ask because i'm allowing
programming on my web2py website and
This used to work for me:
import requests
import requests.auth
Not anymore. I was working on OAuth2.0
Thanks
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report
I create two tables.
db = DAL('sqlite://storage.sqlite')
*db.define_table('maintable',*
* Field('refcode',unique=True,
requires=IS_NOT_IN_DB(db,'maintable.refcode') ),*
* Field('description'))*
*db.define_table('secondtable',*
*
Hello,
I am using the database administration tool to import a small portion of
data to one of the tables in my db (standard sqlite). The code to create
the table:
db.define_table('dict_prod_match',
Field('prod_tes_id','integer'), #this field is causing
troubles
It looks You try to split date with '-' but you'll should use '/'. The
result of splitting your date is whole date string, which is not a proper
int value.
09.02.2018 03:37 "Peter Yoon" napisał(a):
> Hello,
>
> I imported a csv to my table but there were issues in the csv.
I have sending email problems that I am sure are related to SSL/TLS.
I am running the last Web2py version with Python 2.7.9 and Apache 2.4
When I make a mail script with SMTPLIB, Web2py tells me that SSL is not
present. When I want to "import ssl" within a Web2py script, no ssl module
is
Hello,
When I try to import an application I get error. It's my first time that I
get this, I imported plenty apps.
Error ticket for "idstock"Ticket ID
81.164.40.94.2017-01-30.16-32-55.1a6057a7-defb-45ff-af30-25bccb9dbe3e
Cannot import module
imagine table with thousands data
e.g.
name quantity price
product a 10 1
product b 15 11000
and every several months (5 or 6 months) the supplier send the update of
the product price
is it possible to import csv that can update some existing data (*not
insert new data*) in existing
Hi,
I have defined tables:
db.define_table('BL',
Field('name'),
format='%(name)s'
)
db.define_table('PL',
Field('name'),
Field('BL_name', 'reference BL'),
format='%(name)s'
)
As a move to use tcpdump to look at the actual raw response (my issue where
it appears I need to force an ascii response),
I copied my controller code from my dev machine to a test machine. And ran
into import errors trying to import simplejson. (The ticket says it was
trying to load
trying to import *.csv with before insert callback not work correctly (no
error occured but the result is not expected)
*e.g. *
*csv_files_0.csv*
TABLE bonus
bonus.bonus_date,bonus.employee,bonus.is_packing
2016-11-10,4,1
END
*csv_files_1.csv*
TABLE bonus
Hi i have created a module in module/download_pdf/pdf_user where i
implemente the class userpdf the problem is that when is save the file i
received this No module named ecc.. and i have a problem to import...I
don't understand the problem
--
Resources:
- http://web2py.com
-
Il 08/01/16 09:03, Alessio Varalta ha scritto:
> Hi i have created a module in module/download_pdf/pdf_user where i
> implemente the class userpdf the problem is that when is save the file
> i received this No module named ecc.. and i have a problem to
> import...I don't understand the problem
Thanks..I have a big problem :) One day I programmer in Rails, another in
web2py and another with Java and sometimes is diffcult :)
On Friday, 8 January 2016 09:59:07 UTC+1, Manuele wrote:
>
> Il 08/01/16 09:03, Alessio Varalta ha scritto:
> > Hi i have created a module in
Can I import an already designed database into web2py?
Put differently, can I instruct web2py to generate a model page with
define_table statements for existing tables in a database?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py
Hi folks, glad to join this group
I tried to import in Web2Py the attached CSV file ( no sensible data, just
fake info for training ;), after having created the corresponding db.py
It works but only IDs are created for the correct number of rows ( held in
CSV ) but no field is actually loaded,
Hello
I would like to import csv file into a database table - user imports
how do you recommend to do it. I guess telling users to set the column
names matching the headers in CSV but how do i match them after for import.
I also have to add two fields with user id and another one that is based
In rails you can do require filename and use anything from that file. Can
you do something similar in Web2py?
Here's the situation:
fila_a.py in Controllers
file_b.py in Controllers
I need to import most of the functions (or all of them) from file_a.py into
file_b.py.
How can I achieve this?
See http://web2py.com/books/default/chapter/29/04/the-core#API
On Tue, 10 Feb 2015 18:54:33 -0300 lucas wrote
hey everyone,
i am writing a private module, like dude.py under applications/app/private.
how do i access the web2py library like
from gluon.tools import Mail
and have
hey everyone,
i am writing a private module, like dude.py under applications/app/private.
how do i access the web2py library like
from gluon.tools import Mail
and have it run properly under the private module?
thank you in advance, lucas
--
Resources:
- http://web2py.com
-
Hello
I have an app written by someone which runs on our server. I have tried to
copy this app from one server to a new one which also runs web2py. I use
the admin site GUI for web2py to import the app, but when I try to run it,
I get the following error.
error: type
Hi all,
I have a web2py app that runs perfectly fine when running with web2py_src
on windows. However, if i compile and pack the app and attempt to run it
with web2py.exe in windows, I get import errors such as:
type 'exceptions.ImportError' Cannot import module 'requests'
If I type import
Both in trunk and 2.9.5 when running on Apache under mod_wsgi, Windows
server 2008, ActiveState python 2.7.6
When I try to start debug via the admin app, I get a ticket which ends:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
Traceback (most recent call last):
File
Dear web2pyers,
Some functions are packed into a class, which I put it under
modules/myclass.py. To reuse the functions, say in the controllers, I
usually import the module, create a new instance of myclass inside the
controller function. I wonder is it possible to import the module when the
I have placed an __init__.py file in the folder (windows) of the controller
xyz.py but cannot import abc.py at the same location. Any hints to use path
+ file name, or copy the abc.py to where? I am newbee, sorry.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
-
I installed a package (not a single module) with easy_install. The
installation works fine with Python (2.7). The package can be imported and
used without any problems.
Inside web2py the import failed: cannot import module.
As a workaround I placed the package folder in the site-packages folder.
My app uses web2py as a background task (as described in Ch. 4 of the
web2py docs). I have a slow memory leak in the background task. I'm trying
to run guppy periodically to find it but I am getting a error when I try to
use it.
The relevant part of my code looks like this:
import guppy
HI
I have just started using web2py, but have used MVC in other programming
languages, the problem I have gaot is importing a db from MySQL. I use the
script in the scripts folder for extracting from MySQL, which worked fine.
When I added to web2py, most of the tables work fine, but one
hi,
i'm trying to move the ckeditor function from models/db.py into
modules/advanced_editor.py but it return an error.
Traceback (most recent call last):
File /home/mdipierro/make_web2py/web2py/gluon/restricted.py, line 217, in
restricted
File
I have a controller that does an *import requests. *I get the message
Cannot import module 'requests' when trying to run it. I installed
Requests using pip install, and
/Library/Python/2.7/site-packages/ contains *requests-2.1.0-py2.7.egg*. I
can import requests from the Python2.7
Hello all.
I need to import in one table data keeping original id's.
I know that I have to drop the table first, but when I want to import the
CSVfile web2py say me that type 'exceptions.AttributeError' 'DAL' object
has no attribute 'products'
I've tried to follow these instructions:
I am using import csv option to insert records in the database. When I use
the csv file from the web application, then a single record is inserted in
the database with all the records being updated properly as per the headers.
But If I try to use import_from_csv_file outside the web2py, it
Thanks. I'll try import next time.
On Friday, October 4, 2013, Anthony wrote:
And of course, you can always put model code in a module and import it
where needed.
On Friday, October 4, 2013 8:55:26 AM UTC-4, Anthony wrote:
I commented on the issue, but this is the intended behavior. The
Mutatis mutandis…
On Oct 4, 2013, at 7:06 AM, Tim Richardson t...@tim-richardson.net wrote:
Thanks. I'll try import next time.
On Friday, October 4, 2013, Anthony wrote:
And of course, you can always put model code in a module and import it where
needed.
On Friday, October 4, 2013
If I have a conditional model, that is a model in a folder named after its
controller, how can another controller source that model?
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
-
with this db setup:
db.define_table('station', Field('name'), Field('location'), Field('file',
'upload')
db.define_table('records', ('station_id', db.station), Field('col1'),
Field('col2'))
col1-col2 are from file uploaded
i want to have a controller that takes this csv file and imports the
I use Mac Os X Lion
I open the web2py app directly for the server rather than using the
terminal to open.
I want to use MySQL database.
SO where should I place the MySQL db module so that I can import it in the
server.
For a Windows System we can direclty copy the contents to site-packages
Hi,
I am trying to change my database from SQLite to postgres (As some of you
already know :) ) I created a copy of my app (without the database folder)
and changed the database to postgres (which finally works :) )
To get my database I exported every table to a csv file. but when I import
the
Hi Massimo and Dana,
What I missed to notice is to have a __init__.py inside my application's
folder.
after putting it in, import started working fine.
Thanks for timely help.
Regards,
Srinath
http://about.me/srinathgs
http://about.me/srinathgs
I write code @ Alamut
Srinath G S
On Sat,
Hi,
As mentioned in the subject, when I try importing any code inside the
modules forlder of the application's folder, it says,
application.modules not found.
I tried putting __init__.py file in the modules folder. But that didn't
help.
Any suggestions?
http://about.me/srinathgs
I write code @
Which web2py version do you have? How are you doing the import? Please show
us an example. application.modules should not be referenced anywhere in
the source since it does not exist.
On Saturday, 16 February 2013 06:42:56 UTC-6, Srinath G S wrote:
Hi,
As mentioned in the subject, when I
I use the latest web2py(2.3.2).
Let us say the modules folder in my application has a file called utility.py
I try the following in controller
import utility
this issues a ticket saying
Traceback (most recent call last):
File controller name.py, line 1, in module
File path to
I use web2py 2.3.2
Lets say we have a file called utility,py in modules folder.
I try the following in controller
import utility
This throws up the following error.
Traceback (most recent call last):
File controller name.py, line 1, in module
File path to
Can you please try replace gluon/custom_import.py with the one in trunk:
https://raw.github.com/web2py/web2py/master/gluon/custom_import.py
and see if this has been fixed already?
On Saturday, 16 February 2013 10:24:12 UTC-6, Srinath G S wrote:
I use web2py 2.3.2
Lets say we have a file
Not a direct answer but the packed up application is just a gzipped/tar
file so you could just bypass the import function to see what the
application looks like and see if there is a problem with paths etc.
On Saturday, February 16, 2013 4:42:56 AM UTC-8, Srinath G S wrote:
Hi,
As
I have 2.3.2 with python 2.7 on Windows.
I'm importing a module from an odd location in the file system, and
therefore doing
from gluon.custom_import import track_changes; track_changes(True) #while
in development
sys.path.append('C:\...') # a windows path
import mod1#a module in the
Recently I updated web2py from 1.99.4 to 2.3.2. Suddenly, a PDF report
stopped working.
Digging into the problem, I found there is a *pdf.py* file in my
application *modules/* folder. Also, I am using Geraldo Reports in *
web2py/site-packages*.
Geraldo reports has the following file:
Hi all,
I've recently started playing around with web2py and i have encountered a
problem with the csv importing function.
I have a table defined called 'production' and i have already implemetned a
smartgrid that will allow me to view,edit each row in the table.
However, I want to implement a
Hello!
I have some variables in models which I'd like to import to the modules.
How to do it?
--
in models:
myvar = 1
from gluon import current
current.myvar = myvar
On a module
from gluon import current
print current.myvar
On Thu, Jan 3, 2013 at 10:54 AM, Daniel Correia danielcr...@gmail.comwrote:
Hello!
I have some variables in models which I'd like to import to the modules.
How
Thanks for replying! It works!
On Thursday, 3 January 2013 15:58:54 UTC, rochacbruno wrote:
in models:
myvar = 1
from gluon import current
current.myvar = myvar
On a module
from gluon import current
print current.myvar
On Thu, Jan 3, 2013 at 10:54 AM, Daniel Correia
Yes but in model
from gluon import current
print current.myvar # never use correct at top-levet
On Thursday, 3 January 2013 09:58:54 UTC-6, rochacbruno wrote:
in models:
myvar = 1
from gluon import current
current.myvar = myvar
On a module
from gluon import current
print
ok, so you got me thinking about import in the way of models, modules, and
controllers. where does packages fit into that scheme? anyway, reading
sort of confused me more. what is the defined functionality of a model,
module, controller, and package in the python scheme of things? do you
hello one and all,
i am using numpy and scipy pretty heavily within one of my web2py
applications. it takes forever and sometimes the site timeouts or crashes
waiting for the import of the numpy or scipy library calls. a crash may be
the http error 500. but when i start python through the
Hi,
give a bit more information.
Are you importing in models, modules or controllers?
Are you importing in the way
import numpy
import scipy
or
from numpy import X, Y , X
from scipy import X, Y, Z
or
from numpy import *
from scipy import *
?
--
Greetings,
Having difficulty trying to just do a basic PDF test, but getting error's
on the import, well actually not an error, just no results.
Here is my code, you may recognize it from tutorial
from gluon.contrib.fpdf import FPDF
def pdfexp():
pdf=FPDF()
pdf.add_page()
I just upgraded from 2.1 to 2.2.1, and I can no longer import matplotlib. I
get the following error:
ImportError: Cannot import module 'matplotlib'
Is this related to the custom import? Perhaps it is the same as issue 1125?
--
I've been wondering this for a while: is it possible to import my models
from web2py into GAE?
Export is straightforward enough, but unsure how to do import.
If no one has written anything, I could write a script to generate the XML
for importing into that interface
Dear ALL,
How can i make a button that lets the user download a scv file for on of my
tables ?
best regards,
--
Is there a way I can add an import excel (saved as csv) option in the
appadmin that can update multiple data tables (one of them an
intermediate/relational table)?
for example the excel file (saved as csv):
*ID | title |category|*
1 | one |
I would like to know how I would add an import csv (from excel) option to
appadmin that would update multiple database tables (one of them a
relational/intermediate table).
For example, the CSV file would look like this (in excel)
ID | posttitle |category
Hi,
Web2py imports modules from the site-packages directory which is a great
way to build a project withoud any 'external' dependencies.
Only it does not work with modules installed by python easy-install.
Python it's self uses a site module for this, which can be added to web2py
in an easy
Thanks. I do but I still get the same problem. It's interesting that I
have another 3rd party module that I added and it works but mine which just
has some functions test functions in it does not.
I created that file under the module folder through the web2py web
interface.
--
I'm running version 1.91.6 installed from binary for localhost testing. I'm
attempting to add some modules to hold utility functions used by other
controllers but I consistently get an import error.
Suggestions?
Thanks in advance
--
Check if you have an empty __init__.py file under all your root folders.
On Wed, Jun 20, 2012 at 8:19 PM, wdtatenh wdt...@comcast.net wrote:
I'm running version 1.91.6 installed from binary for localhost testing.
I'm attempting to add some modules to hold utility functions used by other
I want to provide import/export CSV file from a specific table for
users. All I want is just like appadmin works. I'm referencing
appadmin code trying to write the code below but I get error
messages. Does anyone can point out what's the problem ?
Example for auth_user table.
Model
Dear All,
am trying to use the PIL and i am using this code :
class RESIZE(object):
def __init__(self,nx=160,ny=80,error_message='niepoprawny plik'):
(self.nx,self.ny,self.error_message)=(nx,ny,error_message)
def __call__(self,value):
if isinstance(value, str) and
Hi , is it possible to built a module in the application itself to
have a functionality of import and export , just like /appadmin ?
i.e. can we have a button in our application on click of which we can
import/export the data ?
Hi ,
I have deployed single app to two different instances , i want to have
some of the data to be common in both the system so i exported the
data in csv from one app and added some data manually into the same
csv then tried to add this csv to another app via import...but this is
not
Hi ,
I have deployed single app to two different instances , i want to
have
some of the data to be common in both the system so i exported the
data in csv from one app and added some data manually into the same
csv then tried to add this csv to another app via import...but this
is
not
On 24 October 2011 12:18, Saurabh S ggtestlo...@gmail.com wrote:
1. if the DB structure is different than the coloumns in csv , will
the import work ?
for example my x table in DB has 10 columns and i am importing a
csv into it with 8 columns...will i be able to do this
successfully
Until now i did all my db queries with the DAL from web2py.
But first the first i now got a raw sql file that needs to be execute
at a certain point.
In the terminal i use the '\i' command to import and execute a sql
script.
If i try to use this with db.executesql(\i /path/to/file.sql) i get
an
Traceback (most recent call last):
File /home/www-data/web2py/gluon/restricted.py, line 192, in restricted
exec ccode in environment
File /home/www-data/web2py/applications/myway/controllers/pastebin.py
http://127.0.0.1:8000/admin/default/edit/myway/controllers/pastebin.py, line
15, in
I'm using the web2py shell mode to run a background process, let's call it
toplevel.py, that waits on pipe for incoming data, processes, and stores it
in the db. Works beautifully. Even supports forking a child process that
monitors the db and sends periodic reports and alerts by email to a
hi
i installed web2py with a script setup-web2py-ubuntu.sh on ubuntu (vps)
in the script, there is installation of reportlab
on windows machine i have put the reportlab in site-packages folder and i
have added some fonts
when i move my application to vps ubuntu server and doing
from
is it possible?
using features nearly introduced and importing modules with
import mymodules
is it possible to have a reload of the modules just modified?
thanks a lot
Manuele
2011/6/20 Manuele Pesenti manuele.pese...@gmail.com
is it possible?
using features nearly introduced and importing modules with
import mymodules
is it possible to have a reload of the modules just modified?
thanks a lot
Manuele
Yes.
You can use the Python reload function.
Or
I wanted to use the w2popenid example application from bitbucket
website : https://bitbucket.org/bottiger/web2py-openid/overview
I have downloaded and placed the code in the applications directory.
I have changed in the models folder the file db.py: this line from
2011/6/15 mb_...@yahoo.fr mb_...@yahoo.fr
I wanted to use the w2popenid example application from bitbucket
website : https://bitbucket.org/bottiger/web2py-openid/overview
I have downloaded and placed the code in the applications directory.
I have changed in the models folder the file db.py:
In a controller of one application I import classes from a module in another
application using either of these syntaxes.
from applications.another_app.modules.mymodule import MyClass
MyClass = local_import('mymodule', app='another_app').MyClass
Is there a better way to do that with the
Has anyone who has used latest debian package been able to import
modules while keeping the application self contained? I have the
traceback from another user's application.
First line of default.py
question_maker = local_import('question_maker')
then when you run it...
Traceback (most recent
Hello list,
instead on paying the bank to get a bankaccount abstract in a machine
readable format I thought I´d write a small application that imports a
HTML page (the source of a page viewing all that has happened on the
bankaccount), parses the file and write all happenings into a database.
Hello.
What is the difference between the statements: import datetime vs from
datetime import datetime
I got stuck with my IS_DATE_IN_RANGE error type
'exceptions.AttributeError'(type object 'datetime.datetime' has no
attribute 'timedelta') until i added import datetime to the
controller. All
I have this table:
db.define_table('region',
Field('name'),
Field('longname'),
Field('subdomain', unique=True),
Field('status_', 'reference region_status')
)
The unique constraint is preventing me in the appadmin from adding
regions with the same subdomain, as intended. However,
as I can import a model from plugin
Example:
myAplication
=models
=controller
=views
.
.
.
.
=plugins_xxx
= models
= plugin_xxx.py
=modules
= libs1py
= libs2.py
In the file models/plugin_xxx.py I write this:
libs1.py
hello
how I can automatically load a database from a csv.
The idea is that when my application starts for the first time, load
the database as countries, states, etc. without having to do it by
hand.
I tried loading it through the next line.
On Sep 6, 12:04 pm, weheh richard_gor...@verizon.net wrote:
web2py Version 1.83.2 (2010-08-15 08:16:30)
I think it's the binary version. How can I tell?
On Sep 6, 11:48 am, mdipierro mdipie...@cs.depaul.edu wrote:
which web2py version? source or binary?
On Sep 6, 10:28 am, weheh
What should be the format of the csv file to import into the db table
using web2py interface.
I have table format as
Tablename (id, col1, col2, col3)
id is auto increment.
Export your actual table you will get the exact format you need csv to
have for the import!
Cheers
Jonhy
On 2010-07-14 14:31, Deepan wrote:
d is auto increment.
I found that importing modules in Web2py seems to be very complex:
http://web2py.com/book/default/section/4/18
I have a module in 'modules' and I do 'import modules.my_module' to
import the module in my application.
This is working fine with Eclipse Pydev because I have setup the
Python path
On Jun 13, 2010, at 4:46 PM, pierreth wrote:
I found that importing modules in Web2py seems to be very complex:
http://web2py.com/book/default/section/4/18
I have a module in 'modules' and I do 'import modules.my_module' to
import the module in my application.
This is working fine with
hi together,
how can i import other external libraries in web2py? is it possible to
load up libs in the static file?
can somebody give me an example?
thanks
peter
Hi
I tried to install the clienttools.py module found here
http://www.web2pyslices.com/main/slices/take_slice/8
However when in my application controller I try to import the module
by doing the following:
clienttools = local_import('clienttools')
page = clienttools.PageManager(globals())
event =
I must import tables from a database manteining the id value of
original tables.
How can I do? It seems not possible force a value in rowid.
Is it possible have more than one autonumber Field (not as rowid) in a
table?
Thanks
leone
--
You received this message because you are subscribed to the
Hi Leone,
leone wrote:
I must import tables from a database manteining the id value of
original tables.
How can I do? It seems not possible force a value in rowid.
Let web2py assign the id incrementally, as normal.
Treat the imported row_id as a separate column of data, but set it as
unique.
95 matches
Mail list logo