Questions tagged [python-elixir]

A Python library that sits upon SQLAlchemy

Elixir is a Python library that sits on top of SQLAlchemy. Questions using this tag should also be tagged .

Further reading:

76 questions
0
votes
1 answer

How to make customizable "order by" for many-to-one relation to itself in Elixir or SQLAlchemy?

We have entity Node: class Node(Entity): parent = ManyToOne('Node') children = OneToMany('Node') When we query like this: nodes = ( Node.query .options( eagerload(Node.children), ) .order_by(desc(Node.id)) …
Andrew
  • 13
  • 4
0
votes
2 answers

Non-existent column when using SQLite and MySQL with Elixir but not when used separately

In my plugin for Qgis I have to use two databases, SQLite and MySQL at the moment, for interfacing with them I use Elixir 0.7.1 and SqlAlchemy 0.7.4. When I only used SQLite, everything was fine, recently I added the module for MySQL, as far I test…
arpho
  • 1,576
  • 10
  • 37
  • 57
0
votes
1 answer

Python Elixir OneToMany and ManyToOne implementation: On Inserting new record with OneToMany relationship?

How do you insert a record with one to many relationship in Python Elixir? See code below. from elixir import * class Product(Entity): using_options(shortnames=True) name = Field(Unicode) category = ManyToOne('Category') brand =…
LEMUEL ADANE
  • 8,336
  • 16
  • 58
  • 72
0
votes
2 answers

How to create a class attribute and class property within Elixir/SqlAlchemy

I have a class: from sys import stderr from elixir import * from types import * class User(Entity): using_options(tablename="users") first_name = Field(String(50)) middle_name = Field(String(50)) last_name = Field(String(50)) …
Brian Bruggeman
  • 5,008
  • 2
  • 36
  • 55
0
votes
1 answer

Elixir Event Handler

I want to use the @after_insert decorator of Elixir, but i can't access the Session within the model. Since i have autocommit set to False, i can't commit any changes in the event handler. Is there any best practice how to deal with that? The Code I…
schneck
  • 415
  • 1
  • 5
  • 8
0
votes
1 answer

How to reference Python elixir object items

I am trying to swap in the key name from a request.param for an Elixir object attribute. Below, the Elixir object bk is a Book() which has an attribute PrintTitle. PrintTitle also comes in from a form as a request.param. Rather than manually map…
MFB
  • 19,017
  • 27
  • 72
  • 118
0
votes
1 answer

How do you make codes/lookup tables in Elixir?

I am looking for a/the best way to make lookup tables or use codes in a relational database made from Python's Elixir. I am not even sure my terminology here is correct. For example, I have a Location table that has a Region column. I want the…
James
  • 522
  • 1
  • 6
  • 7
0
votes
1 answer

SQLAlchemy model definition at execution

I'm writing an ORM using Elixir and SQLAlchemy to handle moving spreadsheet-like data into SQL. In general, the content of the spreadsheet-like data is unknown, and pyparsing parses (meta) data about the spreadsheet-like data from a text file…
justin cress
  • 1,745
  • 5
  • 24
  • 35
0
votes
1 answer

SQLAlchemy IntegrityError

I'm having a problem using SQLAlchemy with PySide(PyQt). I'm trying to pop-up a QtGui.QDialog, but when I do this SQLAlchemy throws an exception: Traceback (most recent call last): File…
Raceyman
  • 1,354
  • 1
  • 9
  • 12
0
votes
2 answers

Problem querying from a model object

I'm trying to use Pylons with SqlAlchemy (through Elixir). Here is my testdb/model/entities.py: from elixir import * metadata.bind = "mysql://testdb:hundertwasser@localhost/testdb" metadata.bind.echo = True class Post(Entity): text =…
lowerkey
  • 8,105
  • 17
  • 68
  • 102
0
votes
1 answer

query.values fails with Elixir

I have a problem with the Elixir declarative layer; I want to retrieve, for every instance of my model, the data of a particular column, like this: File.query.values("column") The thing is, it only works with filtered queries, with the simple…
raph.amiard
  • 2,755
  • 2
  • 20
  • 23
0
votes
1 answer

How to perform an "UPDATE" with elixir

I'm using elixir/flask in a small web app I wrote for my own personal aggregator. I'm trying to create a restful call to mark all items of a particular rssfeed as read. The SQL statement would look something like UPDATE model_rssitems set…
Gekitsuu
  • 87
  • 1
  • 9
0
votes
1 answer

Loading Elixir/SQLAlchemy models in .NET?

A new requirement has come down from the top: implement 'proprietary business tech' with the awesome, resilient Elixir database I have set up. I've tried a lot of different things, such as creating an implib from the provided interop DLL (which…
TrevorB
  • 257
  • 1
  • 3
  • 10
0
votes
3 answers

Write update statement in Python Elixir

I'm using Elixir as my ORM for a MySQL database, I'm having problems writing an update statement, for instance: "update products set price=NULL where id>100" This is my Elixir clsee class Product(Entity): …
mlzboy
  • 14,343
  • 23
  • 76
  • 97
0
votes
1 answer

Add new column on Elixir

I use Elixir as an ORM for a MySQL database. I want to add new column to my schema. / How can I keep the original data in MySQL and update the schema automatically? The concept is called migrate in Ruby on rails.
mlzboy
  • 14,343
  • 23
  • 76
  • 97