Hello
I am trying to update_or_insert records in my db based on two fields. One
is integer for the other I would like to choose month from field. Is this
possible with web2py's DAL or do I have to create a custom SQL statement.
Database is PostgreSQL
thank you
--
Resources:
- http://web2py.
It should be possible using something like
db.your_table.update_or_insert(db.date_field.month() == 12, foo=bar)
--
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 Issues
Hi, does anyone knows how can I perform this MongoDB's query in pyDAL?
db.stores.find({
'menu.items.food.category': 'Pizza'
})
Link to the complete post:
https://stackoverflow.com/questions/51471086/pydal-mongodb-how-to-search-inside-a-json-field
--
Resources:
- http://web2py.com
- http
On Sunday, July 22, 2018 at 10:28:46 PM UTC-7, Rahul wrote:
>
> Hey everyone,
> Any clues on this one? OR should I start updating the
> application and the models with unused field names? Please let me know
>
>
>
Does 'rname' help? You have to poke a bit in the book to find it at fie
tried the script too, but having no luck
*static/scripts/python/mover.py*
def main():
URI = 'mysql://root:mysqlpassword@localhost/site'
other_db = DAL(URI)
print ("creating tables")
for table in db:
other_db.define_table(table._tablename, *[field for field in table]
)
p
>
> tried the script too, but having no luck
> *static/scripts/python/mover.py*
> def main():
> URI = 'mysql://root:mysqlpassword@localhost/site'
> other_db = DAL(URI)
> print ("creating tables")
> for table in db:
> other_db.define_table(table._tablename, *[field for field
tried, modify the code but have another error : ModuleNotFoundError, any
idea?
*static/scripts/python/mover.py*
import site_scheduler
import site_scrape
def main():
URI = 'mysql://root:mysql@localhost/site'
other_db = DAL(URI, auto_import = True)
print ('exporting data')
db.export_
7 matches
Mail list logo