This presentation educates you about Python MySQL - Database Connection, Python MySQL - Database Connection, Establishing connection with MySQL using python with sample program.
For more topics stay tuned with Learnbay.
This presentation educate you about how to create table using Python MySQL with example syntax and Creating a table in MySQL using python.
For more topics stay tuned with Learnbay.
Connect python application with postgreSQL database using psycopg2.
Perform DDL & DML operations
Create table , Insert/update/delete and select records
Understand connection & cursor class
This presentation educates you about Python MySQL - Database Connection, Python MySQL - Database Connection, Establishing connection with MySQL using python with sample program.
For more topics stay tuned with Learnbay.
This presentation educate you about how to create table using Python MySQL with example syntax and Creating a table in MySQL using python.
For more topics stay tuned with Learnbay.
Connect python application with postgreSQL database using psycopg2.
Perform DDL & DML operations
Create table , Insert/update/delete and select records
Understand connection & cursor class
Aspect-based sentiment analysis is a text analysis technique that breaks down text into aspects (attributes or components of a product or service), and then scores the sentiment level (positive, negative or neutral) of each aspect. In this talk we'll walk through a production pipeline for training large Aspect Based Sentiment Analysis model in python with the Intel NLP Architect package based on the following open sourced code https://github.com/microsoft/nlp-recipes/tree/master/examples/sentiment_analysis/absa
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter DataStax Academy
Speakers: Michaël Figuiere, Software Engineer at DataStax & Alex Popescu, Senior Product Manager at DataStax
Video: http://www.youtube.com/watch?v=hK2dXLiYVMI&list=PLqcm6qE9lgKLoYaakl3YwIWP4hmGsHm5e&index=11
Is Cassandra too complex for newcomers? Besides the many improvements that have made their way into C* to dramatically simplify it and the finalized Cassandra Query Language, the SQL-like query language that should look familiar, new drivers have been created with a modern and efficient API. Last, but not least, DataStax is introducing *today* DevCenter 1.0, an IDE whose goal is to simplify developer's workflow even further and to improve their productivity. This presentation will show you how putting to work the new drivers and DevCenter can make your daily life with Cassandra nicer!
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech TalkRed Hat Developers
Moving common network functionality such as client load-balancing and circuit-breaking into out-of-process proxies has kickstarted the technology we call Service Mesh, with Istio as its most popular incarnation. With the introduction of WASM support, you can now extend its functionality by writing custom Filters for Istio's proxy, Envoy, in any language that supports WASM. Let's take a closer look at developing, building, and deploying WASM Filters using the example of an OpenID Connect Filter that adds Keycloak Authentication functionality to any service in your Mesh - no code changes required.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDB’s capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
Aspect-based sentiment analysis is a text analysis technique that breaks down text into aspects (attributes or components of a product or service), and then scores the sentiment level (positive, negative or neutral) of each aspect. In this talk we'll walk through a production pipeline for training large Aspect Based Sentiment Analysis model in python with the Intel NLP Architect package based on the following open sourced code https://github.com/microsoft/nlp-recipes/tree/master/examples/sentiment_analysis/absa
C* Summit EU 2013: Cassandra Made Simple with CQL Drivers and DevCenter DataStax Academy
Speakers: Michaël Figuiere, Software Engineer at DataStax & Alex Popescu, Senior Product Manager at DataStax
Video: http://www.youtube.com/watch?v=hK2dXLiYVMI&list=PLqcm6qE9lgKLoYaakl3YwIWP4hmGsHm5e&index=11
Is Cassandra too complex for newcomers? Besides the many improvements that have made their way into C* to dramatically simplify it and the finalized Cassandra Query Language, the SQL-like query language that should look familiar, new drivers have been created with a modern and efficient API. Last, but not least, DataStax is introducing *today* DevCenter 1.0, an IDE whose goal is to simplify developer's workflow even further and to improve their productivity. This presentation will show you how putting to work the new drivers and DevCenter can make your daily life with Cassandra nicer!
Hacking the Mesh: Extending Istio with WebAssembly Modules | DevNation Tech TalkRed Hat Developers
Moving common network functionality such as client load-balancing and circuit-breaking into out-of-process proxies has kickstarted the technology we call Service Mesh, with Istio as its most popular incarnation. With the introduction of WASM support, you can now extend its functionality by writing custom Filters for Istio's proxy, Envoy, in any language that supports WASM. Let's take a closer look at developing, building, and deploying WASM Filters using the example of an OpenID Connect Filter that adds Keycloak Authentication functionality to any service in your Mesh - no code changes required.
MongoDB is the trusted document store we turn to when we have tough data store problems to solve. For this talk we are going to go a little bit off the path and explore what other roles we can fit MongoDB into. Others have discussed how to turn MongoDB’s capped collections into a publish/subscribe server. We stretch that a little further and turn MongoDB into a full fledged broker with both publish/subscribe and queue semantics, and a the ability to mix them. We will provide code and a running demo of the queue producers and consumers. Next we will turn to coordination services: We will explore the fundamental features and show how to implement them using MongoDB as the storage engine. Again we will show the code and demo the coordination of multiple applications.
Python Utilities for Managing MySQL DatabasesMats Kindahl
Managing a MySQL database server can become a full time job. What we need are tools that bundle a set of related tasks into a common utility. While there are several such utility libraries to choose, it is often the case that you need to customize them to your needs. The MySQL Utilities library is the answer to that need. It is open source so you can modify and expand it as you see fit.
This is the presentation from OSCON 2011 in Portland.
Programmers love Python because of how fast and easy it is to use. Python cuts development time in half with its simple to read syntax and easy compilation feature. Debugging your programs is a breeze in Python with its built in debugger. Using Python makes Programmers more productive and their programs ultimately better. Python is continued to be a favorite option for data scientists who use it for building and using Machine learning applications and other scientific computations.
Python runs on Windows, Linux/Unix, Mac OS and has been ported to Java and .NET virtual machines. Python is free to use, even for the commercial products, because of its OSI-approved open source license.
Python has evolved as the most preferred Language for Data Analytics and the increasing search trends on python also indicates that Python is the next "Big Thing" and a must for Professionals in the Data Analytics domain.
Python has been one of the premier, flexible, and powerful open-source language that is easy to learn, easy to use, and has powerful libraries for data manipulation and analysis. It’s easy to learn simple syntax is very accessible to new programmers and is similar to Matlab, C/C++, Java, or Visual Basic. Python is general purpose and comparatively easy to learn with an increased adoption for analytical and quantitative computing. For over a decade, Python has been used in scientific computing and highly quantitative domains such as finance, oil and gas, physics, and signal processing.
The Agenda for the Webinar:
1. Introduction to Python.
2. Python and Big Data.
3. Python and Data Science.
4. Key features of Python and their usage in Business Analytics.
5. Business Analytics with Python – Real world Use Cases.
Git 101 - Crash Course in Version Control using GitGeoff Hoffman
Find out why more and more developers are switching to Git - distributed version control. This intro to Git covers the basics, from cloning to pushing for beginners.
Introduction to Git/Github - A beginner's guideRohit Arora
Introduction to Git/Github - A beginner's guide
Agenda:
Installing Git
Introduction to Version Control
Git Basics
Creating a new local Git repository
Cloning a Git repository
Making use of Git commit history
Reverting files to previous states
Creating a Github Repository
Adding, Committing & Pushing changes
Branching
Merging Branches
Sending Pull Requests
Conflict Resolution
and 3 Exercises
Orchestrating Docker containers at scaleMaciej Lasyk
Many of us already poked around Docker. Let's recap what we know and then think what do we know about scaling apps & whole environments which are Docker - based? Should we PaaS, IaaS or go with bare? Which tools to use on a given scale?
28.03.15. Одесса. Impact Hub Odessa. Конференция JSLab.
Алексей Волков. "React на практике"
Доклад освещает практические аспекты использования React.js в различном окружении. React и модели Backbone. React и таблицы стилей, а также React в мобильном вебе. Будет полезно как и тем, кто только интересуется этой библиотекой, а также опытным разработчикам.
Подробнее:
http://geekslab.co/
https://www.facebook.com/GeeksLab.co
https://www.youtube.com/user/GeeksLabVideo
Gutenberg sous le capot, modules réutilisablesRiad Benguella
Gutenberg arrive, ça change tout pour ce qui est de la création de contenu dans WordPress. Mais ce que vous ne savez pas c’est que Gutenberg a le potentiel pour changer beaucoup de choses pour les développeurs de plugins et de thèmes WordPress et même à l’extérieur de la communauté WordPress.
De la gestion des données de votre plugin, la gestion des dates, l’internationalisation à l’interface UI, Gutenberg est une mine d’or qui ne demande qu’à être exploitée. Explorons ensemble l’architecture modulaire de Gutenberg et apprenons à réutiliser ses modules pour ses propres projets.
Google App Engine in 40 minutes (the absolute essentials)Python Ireland
This talk covers just the stuff needed to get you up-to-speed with Google App Engine and its associated technologies (based on the Python run-time, of course). In addition to a bit of talking, Paul will also demo a working webapp built and deployed on the App Engine cloud... all in 40 minutes.
Building Cloud-Backed Mobile Apps (MBL402) | AWS re:Invent 2013Amazon Web Services
Connecting your mobile app to AWS can unlock powerful features. With AWS, you can streamline your sign-in experience with social login, store user data in the cloud and share it between devices, display location-specific information using geospatial queries, and engage your customers across multiple platforms with push notifications. In this session, you learn how to integrate these powerful features into a sample mobile app using Amazon DynamoDB, Amazon Simple Notification Service (Amazon SNS), and web identity federation.
This is my talk from Rails Israel 2014. I'm talking about web components, how they work, what libraries exist and how to use web components with Ruby on Rails.
Concurrent programming is one of the major challenges for the software industry. We are in a time of massive experimentation as language designers and programmers search for ways to make concurrent programming easier, less error prone, and more reliable.
This talk will be a survey of concurrent programming constructs which are currently available in some programming language or library. We will look at programming model being presented, as well as examining some of the implementation challenges for the various models.
PyCon US 2009: Challenges and Opportunities for PythonTed Leung
Invited Talk at PyCon 2009
Video on blip.tv at: http://pycon.blip.tv/file/1947412/
We are moving firmly back into a "polyglot" world in terms of programming languages. This presents great opportunities for Python (and other dynamic languages) as well as challenges. In this talk I'll be discussing some of the challenges and opportunities that I see for Python, based on my experience with dynamic language runtimes at Sun.
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
11. Django
Leading web application framework
Lots of people coming to Python via Django today
Model-View-Controller
Command line management scripts
It’s own Rails-like ORM
Based on the Active Record pattern
12. Active Record Pattern
Database table is wrapped in a class
Each class instance is a row in the table
Relationships expressd as foreign key constraints
14. from django.db import models
class User(models.Model):
flickr_id = models.TextField()
name = models.TextField()
def __unicode__(self):
return self.name
class Group(models.Model):
flickr_id = models.TextField()
name = models.TextField()
throttle_count = models.IntegerField()
throttle_mode = models.TextField()
throttle_remaining = models.IntegerField()
def __unicode__(self):
return self.name
15. class Photo(models.Model):
flickr_id = models.IntegerField()
title = models.TextField()
user = models.ForeignKey(User)
groups = models.ManyToManyField(Group)
url = models.URLField()
pub_date = models.DateTimeField()
def __unicode__(self):
return self.title
16. from curator.models import Photo
from datetime import datetime
Photo.objects.all()
Photo.objects.filter(title__contains='PyCon')
Photo.objects.filter(title__contains='PyCon').exclude(
pub_date__lte=datetime(2009,4,1))
Photo.objects.filter(title__contains='PyCon').exclude(
pub_date__lte=datetime(2009,4,1))[2:4]
17. from django.contrib import admin
class PhotoAdmin(admin.ModelAdmin):
pass
class GroupAdmin(admin.ModelAdmin):
pass
class UserAdmin(admin.ModelAdmin):
pass
admin.site.register(Group, GroupAdmin)
admin.site.register(Photo, PhotoAdmin)
admin.site.register(User, UserAdmin)
18. def load_from_flickr(request):
api = API()
# 51035696189@N01
twl, created = User.objects.get_or_create(
flickr_id = '51035696189@N01',
name = 'Ted Leung'
)
if created:
twl.save()
photos = api.list_user_info(
'http://www.flickr.com/photos/twleung')
20. # do pools
for pool in pools:
new_pool, created=Group.objects.get_or_create(
flickr_id = pool[0],
name = pool[1],
throttle_count = pool[2],
throttle_mode = pool[3],
throttle_remaining = pool[4]
)
new_photo.groups.add(new_pool)
if created:
new_pool.save()
26. ../bin/django startmigration curator --initial
Creating migrations directory at '/Users/twl/work/
mysql-2009/django/flickrmgr/curator/migrations'...
Creating __init__.py in '/Users/twl/work/mysql-2009/
django/flickrmgr/curator/migrations'...
+ Added model 'curator.Photo'
+ Added model 'curator.Group'
+ Added model 'curator.User'
+ Added field 'curator.Photo.groups'
Created 0001_initial.py.
27. class Photo(models.Model):
flickr_id = models.IntegerField()
title = models.TextField()
user = models.ForeignKey(User)
groups = models.ManyToManyField(Group)
url = models.URLField()
pub_date = models.DateTimeField()
visible = models.BooleanField()
29. from south.db import db
from django.db import models
from curator.models import *
class Migration:
def forwards(self, orm):
# Adding field 'Photo.visible'
db.add_column('curator_photo', 'visible',
models.BooleanField())
def backwards(self, orm):
# Deleting field 'Photo.visible'
db.delete_column('curator_photo', 'visible')
30. SQLObject
ORM using Active Record pattern
Tight coupling to Python classes
Used in TurboGears 1
45. metadata.create_all(engine)
conn = engine.connect()
s = select([users_table])
result = conn.execute(s)
for row in result:
print row
s = select([photos_table],
photos_table.c.title.contains('PyCon'))
for row in conn.execute(s):
print row
46. ins = users.insert().values(name='Thomas Hawk',
flickr_id='000')
result = conn.execute(ins)
update =
users.update().where(
users.c.name=='Thomas Hawk'
).values(
flickr_id='51035555243@N01'))
result = conn.execute(update)
49. Other Low Level SQL features
Unions and other Set operations
Scalar Selects
Correlated Subqueries
Ordering, Grouping, Offsetting
Correlated Updates
53. from sqlalchemy.orm import mapper, sessionmaker
engine = create_engine(
'mysql://twl:pass@localhost/sqlobject')
54. Session = sessionmaker(bind = engine)
session = Session()
mapper(User, users_table, properties = {
'photos' : relation(Photo, backref='user')
})
mapper(Group, groups_table, properties = {
'photos' : relation(Photo,
secondary=flickr_group_photo,
backref='groups')
})
mapper(Photo, photos_table)
for u in session.query(User):
print u
for g in session.query(Group):
print g
for p in session.query(Photo):
print p
58. class Photo(Base):
__tablename__ = 'photo'
id = Column(Integer, primary_key=True)
flickr_id = Column(Text)
title = Column(Text)
user_id = Column(Integer,ForeignKey('user.id'))
user = relation(User,
backref=backref('photos', order_by=id))
groups = relation('Group',
secondary=flickr_group_photo,
backref=backref('photos'))
url = Column(Text)
pub_date = Column(DateTime)
def __repr__(self):
return quot;<Photo('%s','%s','%s','%s')>quot; % (
self.id,
self.flickr_id,
self.title,
self.url
)
59. Session = sessionmaker(bind = engine)
session = Session()
for u in session.query(User):
print u
for g in session.query(Group):
print g
for p in session.query(Photo):
print p
64. class Photo(Entity):
using_options(tablename = 'photo')
flickr_id = Field(Text)
title = Field(Text)
url = Column(Text)
pub_date = Column(DateTime)
groups = ManyToMany('Group')
user = ManyToOne('User')
def __repr__(self):
return quot;<Photo('%s','%s','%s','%s')>quot; % (
self.id,
self.flickr_id,
self.title,
self.url
)
65. engine = create_engine(
'mysql://twl:pass@localhost/sqlobject', echo=True)
Session = sessionmaker(bind = engine)
session = Session()
metadata = MetaData()
metadata.bind='mysql://twl:pass@localhost/sqlobject'
metadata.bind.echo = True
setup_all()
for u in session.query(User):
print u
for g in session.query(Group):
print g
for p in session.query(Photo):
print print