[web2py] Re: import a database into web2py

2016-01-06 Thread Adrien
Hi, I don't know if web2py can do that but i have a python script which create the define_table statements. You have to execute with the terminal and python (on windows : python yourscript.py). And for the primary key in the table, you have to modify the type (put id instead of int). #!/usr/bi

[web2py] Re: Can't use to download a file

2015-12-18 Thread Adrien
Oh ok thanks Anthony, i used that : clep I didn't know i have to use the static folder to upload files, thx you :) Le jeudi 17 décembre 2015 16:58:05 UTC+1, Anthony a écrit : > > On Thursday, December 17, 2015 at 9:34:33 AM UTC-5, Adrien wrote: >> >> Hi everyone, >&

[web2py] Can't use to download a file

2015-12-17 Thread Adrien
Hi everyone, I'm trying to create a link to download files, but it doesn't work .. It redirect me like a simple link. This is what i'm using : This file is default/index.html clep I also tried to use the all path (from C: to the file) but it doesn't work too. Anyone have an idea to fix this

[web2py] Re: How to upload a file in a directory without SQLFORM ?

2015-12-16 Thread Adrien
s > filepath = os.path.join(request.folder, 'view', 'pictures', filename) > > Again, don't just use the filename provided by the user, as that is a > security vulnerability. > > Anthony > > On Wednesday, December 16, 2015 at 10:13:10 AM UTC-5, Adrien wrote

[web2py] Re: How to upload a file in a directory without SQLFORM ?

2015-12-16 Thread Adrien
For the path, i just don't write my path but it works only when i used the all path (from C:/ to my folder pictures like "C:/Adrien/web2py/applications/myApp/view/pictures/", don't know how to write only "pictures/"). So if i can resolve this and find how to chang

[web2py] Re: How to upload a file in a directory without SQLFORM ?

2015-12-16 Thread Adrien
This is the subject where i found the previous code : https://groups.google.com/forum/#!searchin/web2py/upload$20file$20in$20directory$20with$20form/web2py/nyLx2MBLG2k/HQQ8a95D9oIJ Le mercredi 16 décembre 2015 11:17:05 UTC+1, Adrien a écrit : > > Thx for your quick answer. > But i try

[web2py] Re: How to upload a file in a directory without SQLFORM ?

2015-12-16 Thread Adrien
.html: > > {{extend 'layout.html'}} > > Upload File > {{=form}} > > > > > thats it. > > 16 Aralık 2015 Çarşamba 11:07:11 UTC+2 tarihinde Adrien yazdı: >> >> >> Hi everyone, >> Like i said in the title, i want to upload a file in a

[web2py] How to upload a file in a directory without SQLFORM ?

2015-12-16 Thread Adrien
Hi everyone, Like i said in the title, i want to upload a file in a directory with a form. I saw another subject where he did what i want but with me, it doesn't work and i don't know why. This is my controller default.py : def test(): import shutil filename=request.vars.filename

[web2py] Re: How to add à link with arguments in SQLFORM.grid

2015-12-02 Thread Adrien
Okay, it works ! I understand now, thx Anthony ! Le mercredi 2 décembre 2015 14:46:26 UTC+1, Anthony a écrit : > > On Wednesday, December 2, 2015 at 6:55:22 AM UTC-5, Adrien wrote: >> >> links = [dict(header='', body=lambda row : A(db.generalfix.IdGene, >> _

[web2py] How to add à link with arguments in SQLFORM.grid

2015-12-02 Thread Adrien
Hi everyone, I'm working on web2py for the first time and i have to make a grid with multiple tables. That works but i want to have a link with the id of one table and i don't know how to send this id. I made the following code : fields = (db.generalfix.IdGeneralFix, db.gene.NameGene, db.gene

[web2py] Re: auth have no key user ????

2012-04-04 Thread bussiere adrien
it's not that i 've corrected but not htat it drives me crazy it worked yesterday : def invitation(): form=FORM("Code Invitation :", INPUT(_name='invitation')," 'User'VERSIONweb2py™(1, 99, 7, datetime.datetime(2012, 3, 4, 22, 12, 8), 'stable')PythonPython 2.5.4: C:\Users\Bussiere\Dropbox\Pr

[web2py] auth have no key user ????

2012-04-04 Thread bussiere adrien
i truly don't understand it seems to work before at my last commit and now i have a bug : 127.0.0.1.2012-04-04.14-49-48.50c46aad-96a9-4d70-9b67-009e81ed17f0 'User' Traceback (most recent call last): File "gluon/restricted.py", line 205, in restricted File "C:/Users/Bussiere/Dropbox/Pro

Re: [web2py] adding an item in a list:reference :

2012-04-02 Thread bussiere adrien
le a écrit : > > Il 01/04/2012 23:23, bussiere adrien ha scritto: > > ok i see the example : > > >>> db.define_table('tag',Field('name'),format='%(name)s') > > >>> db.define_table('product', > >

[web2py] Re: Separate form elements in a view ?

2012-04-01 Thread bussiere adrien
orm-elements-and-attributes > . > > Anthony > > On Sunday, April 1, 2012 11:53:49 AM UTC-4, bussiere adrien wrote: >> >> How to separate element from a form in a view ? >> {{= form }} >> make the whole form. >> >> But i i want to use it one by one for css ? >

[web2py] adding an item in a list:reference :

2012-04-01 Thread bussiere adrien
ok i see the example : >>> db.define_table('tag',Field('name'),format='%(name)s') >>> db.define_table('product', Field('name'), Field('tags','list:reference tag')) >>> a = db.tag.insert(name='red') >>> b = db.tag.insert(name='green') >>> c = db.tag.insert(name='blue') >>> db.produ

[web2py] Separate form elements in a view ?

2012-04-01 Thread bussiere adrien
How to separate element from a form in a view ? {{= form }} make the whole form. But i i want to use it one by one for css ? is there a way to do it like : {{= form.Email }} Regards Bussiere here is my form : form2 = FORM( TABLE( TR( TD( LABEL('E

[web2py] Re: Dynamically create form ?

2012-03-29 Thread bussiere adrien
'I agree to the terms and conditions'), \ INPUT(_name='agree',value=True,_type='checkbox')) form[0].insert(-1,my_extra_element) Le jeudi 29 mars 2012 14:14:01 UTC+2, bussiere adrien a écrit : > > is there a way to dynamically create a for

[web2py] Dynamically create form ?

2012-03-29 Thread bussiere adrien
is there a way to dynamically create a for like : liste = ["titi","toto"] form=FORM("UserName:", INPUT(_name='Username'), "Email : ", INPUT(_name='email',_value=user.email), ) for l in liste : form.add("%s : "%l,INPUT(_name="%s"%l)) # and at the end add the submit button : form.add(IN

[web2py] database foreign key question

2012-03-29 Thread bussiere adrien
Thanks to you my project make nice progress : http://img26.imageshack.us/img26/1271/loginscreena.png But i need to know some things : here is my database : db.define_table('Skill', Field('Nom', unique=True), format = '%(Nom)s') db.define_table('SkillLevel', Field('Level', 'integer'), Field(

Re: [web2py] Re: 10.24$ reward for a recipe logging a user

2012-03-26 Thread bussiere adrien
It work Thanks Just mail me in private where to give Bussiere Le lundi 26 mars 2012 20:23:06 UTC+2, selecta a écrit : > > if it works please donate to the web2py project > > >

[web2py] Re: 10.24$ reward for a recipe logging a user

2012-03-25 Thread bussiere adrien
t so it can be tracked. > > On Sunday, 25 March 2012 11:57:20 UTC-5, bussiere adrien wrote: >> >> I want to create myself a user then log him. >> This for an open source project : >> https://github.com/bussiere/​​jackpoint<https://github.com/bussiere/jackpoint> >&g

Re: [web2py] 10.24$ reward for a recipe logging a user

2012-03-25 Thread bussiere adrien
> > Suggestion 2: > This function may be useful: (in Auth) get_or_create_user() > I don't think it is documented in the book at present. > > > On Sunday, 25 March 2012 19:45:51 UTC+1, bussiere adrien wrote: >> >> It still redirect me to the the auth page with the lo

Re: [web2py] 10.24$ reward for a recipe logging a user

2012-03-25 Thread bussiere adrien
It still redirect me to the the auth page with the login form Bussiere Le dimanche 25 mars 2012 19:37:44 UTC+2, Vasile Ermicioi a écrit : > > that works for me > > def test(): > password="toto" > my_crypt = CRYPT(key=auth.settings.hmac_​key) > crypt_pass = my_crypt(password)[0]

[web2py] 10.24$ reward for a recipe logging a user

2012-03-25 Thread bussiere adrien
I want to create myself a user then log him. This for an open source project : https://github.com/bussiere/jackpoint I've been on it for 3 days now. I want to create a user then loggin him and auth him. If you find it just give me your paypal in private buy you a drink. Here is my code : def tes

[web2py] Re: Acces a page with @auth.requires_login() don't work

2012-03-25 Thread bussiere adrien
myself. Bussiere Le dimanche 25 mars 2012 16:50:36 UTC+2, Sushant Taneja a écrit : > > Just a thought here, but have you tried logging out and logging in again > with the same password. Does it work ? > > On Sunday, March 25, 2012 3:47:53 PM UTC+5:30, bussiere adrien wrote: >>

[web2py] Acces a page with @auth.requires_login() don't work

2012-03-25 Thread bussiere adrien
i've created and logged my user with : password="toto" my_crypt = CRYPT(key=auth.settings.hmac_key) crypt_pass = my_crypt(password)[0] user = db.auth_user.insert( Surnom="Surnom", email="email", password=crypt_pass, ) db.commit() sess

[web2py] Re: simple recipe to create a user and loggin him ?

2012-03-24 Thread bussiere adrien
sion.auth = Storage(user=user,expiration=auth.settings.expiration,hmac_key=str(uuid4())) auth.login_bare(user,password) that thing don't work ... Bussiere Le samedi 24 mars 2012 16:27:22 UTC+1, bussiere adrien a écrit : > > I need a simple recipe juste to create a user in command line

[web2py] simple recipe to create a user and loggin him ?

2012-03-24 Thread bussiere adrien
I need a simple recipe juste to create a user in command line / program to create him and log him as : like : user = db.auth_user.insert(name="johndoe",password="toto") auth.user = user auth.environment.session.auth = Storage(user=user, last_visit=request.now,

[web2py] 'tuple' object has no attribute 'items'

2012-03-24 Thread bussiere adrien
I don't understand here is my db : from gluon.tools import Auth, Crud, Service, PluginManager, prettydate auth = Auth(db, hmac_key=Auth.get_or_create_key()) crud, service, plugins = Crud(db), Service(), PluginManager() db.define_table( auth.settings.table_user_name, Field('Surnom', length=128, defa

[web2py] Re: display fill text in a {{ row }} not the trucate one

2012-03-24 Thread bussiere adrien
; {{=SQLTABLE(rows, truncate=None)}} > > Anthony > > On Saturday, March 24, 2012 9:41:51 AM UTC-4, bussiere adrien wrote: >> >> I have this when i put a {{row}} in a template (liste_invitations) : >> {{extend 'layout.html'}} >> Records >> {{

[web2py] display fill text in a {{ row }} not the trucate one

2012-03-24 Thread bussiere adrien
I have this when i put a {{row}} in a template (liste_invitations) : {{extend 'layout.html'}} Records {{=rows}} it gives me : Invitation.id Invitation.Code Invitation.Usage Invitation.Donneur Invitation.Receveur Invitation.Email Invitation.Used 1 Toto-5542 None None None None None 2 USER_INTERFA

Re: [web2py] Invalid syntax

2012-03-23 Thread bussiere adrien
Yep that was that the encoding thanks all i did a replace with this regexp : /[^\x00-\x7F]/ But it was hard to understand ... Thanks Bussiere Le vendredi 23 mars 2012 15:14:02 UTC+1, Jonathan Lundell a écrit : > > On Mar 23, 2012, at 2:40 AM, bussiere adrien wrote: > > # -*- c

[web2py] Invalid syntax

2012-03-23 Thread bussiere adrien
# -*- coding: utf-8 -*- def ensurefirstuser(firstname,lastname,email,password)​: users = db(db.auth_user.email==email).​select() if users: user_id = users[0].id created = False if settings.debug_ensure_first_​user == True: print ('found user_id so created

[web2py] Re: infinite loop with form.process().accepted

2012-03-23 Thread bussiere adrien
> > Thanks a lot. > It was obvious for me that it was an int. Thanks again Bussiere

[web2py] infinite loop with form.process().accepted

2012-03-22 Thread bussiere adrien
i don't understand : def generate_invitation(number,word=4,num=1,numdigit=5): code = [ ['BELCHER', 'FIX', 'EEL', 'PANZERBOY', 'DESK_JOCKEY', 'CHILLED', 'ENFORCER', 'CHERRY_PICKING', 'COUNTRY_CLUB', 'BOMBSHELL', 'PLUGGED_IN', 'FINI', 'LEGIT', 'JAM', 'BONED_OUT', 'BLADE', 'ROUST', 'SAMURAI', 'D

[web2py] Re: Current status of adapting OrientDB for web2py

2012-03-18 Thread bussiere adrien
Mee to i'am considering using orientdb also. So if you have any example regards Bussiere Le jeudi 16 février 2012 09:27:55 UTC+1, David Marko a écrit : > > I would also appreciate some hints on what libraries do you use to > communicate with orientDB, or can you create some simple appliance as

[web2py] Re: list:reference and crud.create a form in a form or a popup (django style) recipe ?

2012-03-18 Thread bussiere adrien
e arguments and returns a helper. > For a detailed example check the online manual at 7.7 Widgets > > On 17 mar, 11:11, bussiere adrien wrote: > > Is there a recipe anywhere to show how to do when a i have a external > > reference in my db table as liste:reference > > t

[web2py] list:reference and crud.create a form in a form or a popup (django style) recipe ?

2012-03-17 Thread bussiere adrien
Is there a recipe anywhere to show how to do when a i have a external reference in my db table as liste:reference to make it simple to add existing references or make a popup to create a new reference ? exemple : db.define_table('Film', Field('nom'), Field('Acteur','list:reference Acteur')

[web2py] Re: Key error that i don't understand based on the cookbook.

2012-03-17 Thread bussiere adrien
Found it all my db have name and one had a mystake. Regards Bussiere Le samedi 17 mars 2012 14:35:30 UTC+1, bussiere adrien a écrit : > > here is my db.py : > > db.define_table('ImageFilmPreview', >Field('Nom'), >Field('date_Creation

[web2py] Re: Key error that i don't understand based on the cookbook.

2012-03-17 Thread bussiere adrien
Found it the error was not so explicit all my name film and actors was name. Bussiere Le samedi 17 mars 2012 14:35:30 UTC+1, bussiere adrien a écrit : > > here is my db.py : > > db.define_table('ImageFilmPreview', >Field('Nom'), >Field(&#

[web2py] Key error that i don't understand based on the cookbook.

2012-03-17 Thread bussiere adrien
here is my db.py : db.define_table('ImageFilmPreview', Field('Nom'), Field('date_Creation','date'), Field('Tag','list:reference Tag'), Field('FamilleTag','list:reference FamilleTag'), Field('Type','list:reference Type'), Field('Valeur_Ticket','double'), Field('Description_Cour

[web2py] {{pass}} problems

2012-03-14 Thread bussiere adrien
i don't understand the pass ... I anyone have a better tutorial than the official one. Here is my layout.html : Projet Jackpoint body{ color:#b7d14e; background-color:#000f00; margin:4px; margin-top:0px; font-family:monospace; } a:link{ color:#94d118; } a:visited{ color:#94a443; } he

[web2py] call function in template layout

2012-03-14 Thread bussiere adrien
i would like to know if it's possible to call a home made function in a template. i've made this gist and i would like to call it in template : https://gist.github.com/2032147 like : {{ encadrement(form) }} And where to place my gist to call it in template. And if not, where to put this functi

[web2py] Custom register form with personnalised Auth

2012-03-11 Thread bussiere adrien
here is my auth table : (the beginning my table is correct) db.define_table( auth.settings.table_user_name, Field('Nom'), Field('Prenom'), Field('Telephone'), # NOte on user is intern and the user don't hve to see it. Field('Note on user'), How to make a custom sqlform from it

Re: [web2py] (Field: unknown field type: float for Price)

2012-03-11 Thread bussiere adrien
i owe you one. But on the web i see float ? http://web2py.wordpress.com/ Le dimanche 11 mars 2012 10:26:29 UTC+1, rochacbruno a écrit : > > There is no float, it is double in web2py > > > > Field ('Price', 'double'), > > > > -- > > Bruno Rocha

[web2py] (Field: unknown field type: float for Price)

2012-03-11 Thread bussiere adrien
here is my error : Traceback (most recent call last): File "gluon/restricted.py", line 205, in restricted File "C:/Users/Bussiere/Dropbox/Projets/Yuki/web2py/applications/init/models/db.py" , line 327, in File "gluon/dal.py", li

[web2py] Re: How to list:reference users ?

2012-03-11 Thread bussiere adrien
thanks Le dimanche 11 mars 2012 04:36:37 UTC+1, bussiere adrien a écrit : > > maybe Field('Auth','list:reference Auth'), > or ('Auth','list:reference User'), > > Regards > Bussiere >

[web2py] How to list:reference users ?

2012-03-10 Thread bussiere adrien
maybe Field('Auth','list:reference Auth'), or ('Auth','list:reference User'), Regards Bussiere

Re: [web2py] Database trigger like django save ?

2012-03-09 Thread bussiere adrien
t; patching the .insert method. > > But it will be very better if DAL can handle this out of the box. > > A suggestions is adding an "callback" in .insert method > > def myfunction(id): > . > > db(db...).insert(**., _callback=myfunction) > &

[web2py] Re: How to call other web2py applications from within a web2py application

2012-03-09 Thread bussiere adrien
this doc is outdated is there anything news for making a website with more than one app ? regards Bussiere Le lundi 15 mars 2010 16:19:23 UTC+1, mdipierro a écrit : > > For now look at the following links that may help you: > > For an example of {{=LOAD(...)}} > >http://gluonframework.wordpr

[web2py] Database trigger like django save ?

2012-03-09 Thread bussiere adrien
Is there a way to do that in web2py : i've found only this : http://russcomp.wordpress.com/2011/10/12/web2py-re-db-events-trigger/ To perform action on a save ? class Acteur(models.Model): Pseudo = models.CharField(max_length=200,null=True,blank=True) Tag = models.ManyToManyField('tags.T

[web2py] Re: Auth redefinition for all apps

2012-03-09 Thread bussiere adrien
thanks i will do that Bussiere Le vendredi 9 mars 2012 23:18:36 UTC+1, pbreit a écrit : > > I don't think there's a way to redefine auth for all apps short of > modifying Web2py itself (which I would not advise). > > I would suggest simply putting your customization into each project where > yo

[web2py] Auth redefinition for all apps

2012-03-09 Thread bussiere adrien
i 've found this : http://web2py.com/books/default/chapter/29/9#Customizing-Auth But how redefine auth db for all apps ? Regards Bussiere

[web2py] Re: looking for tutorial extends user and related to an other app

2012-03-09 Thread bussiere adrien
i've found this : http://stackoverflow.com/questions/7121146/web2py-custom-user-profile But i still have problems to find how to make list:related to an ohter app or make a global auth extend in db for all app. Regards Bussiere Le jeudi 8 mars 2012 21:47:08 UTC+1, bussiere adrien a

[web2py] looking for tutorial extends user and related to an other app

2012-03-08 Thread bussiere adrien
Hello i'am looking for tutorial to : Extends user add field to database. Then : an app street an app buildint link building field with street field And more tutorial Regards Bussiere