Comments (5)
From [email protected] on February 07, 2012 09:20:46
can you send me a patch?
from web2py.
From [email protected] on February 07, 2012 09:22:30
I see you posted the patch. thanks in the next issue.
Status: Duplicate
from web2py.
From [email protected] on February 08, 2012 12:36:48
This is not a duplicate of 649.
The patch for #649
does not solve the default "requires" issue being wrong, as the form constraints have already been generated for the original (non existant table), and you need to put requires=[] on the original unique column or the sqlform / app admin has an exception when trying to validate inserted records.
I think the only way to really solve this issue is to copy the original "requires" of the field, and when copying a table, use the original requires (not the already set-up requires as is done now, which already has the wrong value), which will get expanded correctly. I would have done this patch, but it is in parts of the DAL I'm not yet feeling comfortable modifying -- I might do that in the next few weeks.
(Also, if that is being done, I suggest adding a "selfref" column type, which will expand to reference the current table, which is a cleaner solution than the current 649 patch, as it is never ambiguous -- but it only works if copying the original field type is done first, as is suggest in this issue)
from web2py.
From [email protected] on March 12, 2012 13:05:46
Status: Accepted
from web2py.
From [email protected] on September 11, 2012 14:33:43
Not sure if connected, but Unique does not work here (at least for Sqlite) ...
db.define_table('test', Field('name'), Field('person_id', 'reference person', unique=True))
In theory this would provide a constraint for a 1-1 relationship. Not a popular thing to do, but I guess it should still work, or documented that it doesn't.
from web2py.
Related Issues (20)
- Admin application fails on Python 3.10 in version 2.23.0 HOT 2
- SSLv3 unknown certificate
- web2py 2.23.0 is giving a 403 error when I try to package my applications
- SECURITY: JQuery 1.2 < 3.5.0 Multiple XSS
- Scheduler does not exit on OperationalError HOT 9
- Lack of checking if the supplied value is numerical in SQLFORM.grid search function HOT 2
- scheduler.py AttributeError: '_thread._local' object has no attribute '_scheduler'
- SECURITY: Vulnerable to HTTP Response Splitting
- Error when searching with SQLFORM.grid with order field selected HOT 1
- Add to book recipie? - How to host web2py with python3 on cpanel server
- blank admin
- Circular import
- About Sessions Storage
- web2py does not work with Python 3.12 HOT 3
- The new version (2.27.1) does not work for me HOT 1
- SECURITY.md contains no email contact
- db.export_to_csv_file does not correctly back up a database with record versioning enabled. HOT 2
- web2Py admin pages cant be opened when the webserver is behind a (reverse) proxy Server
- pydal 20240427 breaks gluon/login HOT 1
- Record versioning blocks update occasionally
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web2py.