From: sturlamolden on
On 17 Jul, 07:29, Nathan Rice <nathan.alexander.r...(a)gmail.com> wrote:

> Let’s push things to the edge now with a quick demo of many to many
> relationship support. For this example we’re going to be using the
> following XML:
>
> <Departments>
>     <Department>
>         <DeptNum>123</DeptNum>
>         <DeptName>Sales</DeptName>
>         <Employee>
>             <Number>143</Number>
>             <Name>Raul Lopez</Name>
>         </Employee>
>         <Employee>
>             <Number>687</Number>
>             <Name>John Smith</Name>
>         </Employee>
>         <Employee>
>             <Number>947</Number>
>             <Name>Ming Chu</Name>
>         </Employee>
>     </Department>
>     <Department>
>         <DeptNum>456</DeptNum>
>         <DeptName>Marketing</DeptName>
>         <Employee>
>             <Number>157</Number>
>             <Name>Jim Jones</Name>
>         </Employee>
>         <Employee>
>             <Number>687</Number>
>             <Name>John Smith</Name>
>         </Employee>
>         <Employee>
>             <Number>947</Number>
>             <Name>Ming Chu</Name>
>         </Employee>
>     </Department>
> </Departments>


Oh yes, I'd rather write pages of that rather than some SQL in a
Python string.



From: Emile van Sebille on
On 7/17/2010 6:25 AM sturlamolden said...
> On 17 Jul, 07:29, Nathan Rice<nathan.alexander.r...(a)gmail.com> wrote:
>
>> Let�s push things to the edge now with a quick demo of many to many
>> relationship support. For this example we�re going to be using the
>> following XML:
>>
>> <Departments>
>> <Department>
>> <DeptNum>123</DeptNum>
>> <DeptName>Sales</DeptName>
>> <Employee>
>> <Number>143</Number>
>> <Name>Raul Lopez</Name>
>> </Employee>
>> <Employee>
>> <Number>687</Number>
>> <Name>John Smith</Name>
>> </Employee>
>> <Employee>
>> <Number>947</Number>
>> <Name>Ming Chu</Name>
>> </Employee>
>> </Department>
>> <Department>
>> <DeptNum>456</DeptNum>
>> <DeptName>Marketing</DeptName>
>> <Employee>
>> <Number>157</Number>
>> <Name>Jim Jones</Name>
>> </Employee>
>> <Employee>
>> <Number>687</Number>
>> <Name>John Smith</Name>
>> </Employee>
>> <Employee>
>> <Number>947</Number>
>> <Name>Ming Chu</Name>
>> </Employee>
>> </Department>
>> </Departments>
>
>
> Oh yes, I'd rather write pages of that rather than some SQL in a
> Python string.
>

That's not the point. I've got examples of XML content that I don't
create that could be tamed quite easily (if I understand from a quick
once over).

This looks really interesting. I've got to go read more now...

Emile


From: Nathan Rice on
> Oh yes, I'd rather write lines of that rather than pages of SQL in a Python string.

(not to mention, avoid some easy to fall into security flaws, not have
to worry about porting dialect specific SQL code, etc, etc).

Fixed that for you. I can't take the credit for that part though,
that magic comes from SQL Alchemy. All Struqtural does is let you
move data into a database easily, move data from a database to Python
easily, and simplify the creation of some common complex schemas.