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
1
vote
1 answer

How do you save models in Elixir

I've got a database created using Django models which I'm now accessing using SQLAlchemy and Elixir. The querying works and I can pull items out of the database perfectly happily but when I edit them and try to save them it throws the following…
Haegin
  • 530
  • 3
  • 11
1
vote
1 answer

SQLAlchemy/Elixir - querying to check entity's membership in a many-to-many relationship list

I am trying to construct a sqlalchemy query to get the list of names of all professors who are assistants professors on MIT. Note that there can be multiple assistant professors associated with a certain course. What I'm trying to do is roughly…
Marcin
  • 591
  • 5
  • 12
1
vote
1 answer

SQLAlchemy/Elixir validation rules?

I just found out how to validate my database input before saving it, but I'm kinda bummed to find there are no premade rules (like validate email, length, etc) that are found in some web based frameworks. Are there any validation libraries laying…
ryeguy
  • 65,519
  • 58
  • 198
  • 260
1
vote
1 answer

how to leave a computed field alone when writing to db using Elixir session.commit()

I am using Elixir to connect to MSSQL database. The database has a table with a computed column in it. However, when I update other columns in the object and commit the changes, python tells me I can't insert to the computed column. I am using…
MFB
  • 19,017
  • 27
  • 72
  • 118
1
vote
1 answer

Is there an equivalent of ActiveRecord's find(:include) in Elixir/SQLAlchemy?

I had been using ActiveRecord previously and it allowed to load all associations of an object using an optional :include argument to its dynamic finders. I have recently started using Elixir for a python project and am unable to find any…
Chandranshu
  • 3,669
  • 3
  • 20
  • 37
1
vote
1 answer

SQLAlchemy & Complex Queries

I have to implement ACL for an existing application. So I added the a user, group and groupmembers table to the database. I defined a ManyToMany relationship between user and group via the association table groupmembers. In order to protect some…
Ümit
  • 17,379
  • 7
  • 55
  • 74
1
vote
3 answers

Sqlalchemy+elixir: How query with a ManyToMany relationship?

I'm using sqlalchemy with Elixir and have some troubles trying to make a query.. I have 2 entities, Customer and CustomerList, with a many to many relationship. customer_lists_customers_table = Table('customer_lists_customers', …
Hugo
  • 2,139
  • 4
  • 22
  • 30
1
vote
1 answer

In Elixir or SQLAlchemy, is there a way to also store a comment for a/each field in my entities?

Our project is basically a web interface to several systems of record. We have many tables mapped, and the names of each column aren't as well named and intuitive as we'd like... The users would like to know what data fields are available (i.e.…
kafuchau
  • 5,573
  • 7
  • 33
  • 38
1
vote
1 answer

Elixir not creating my tables with default values

class MyObject(Entity): name = Field(Unicode(256), default=u'default name', nullable=False) using_options(shortnames=True) using_mapper_options(save_on_init=False) def __init__(self): self.name = None I am using MySQL in…
Joel Hooks
  • 6,465
  • 4
  • 33
  • 39
1
vote
2 answers

Using multiple databases with Elixir

I would like to provide database for my program that uses elixir for ORM. Right now the database file (I am using SQLite) must be hardcoded in metadata, but I would like to be able to pass this in argv. Is there any way to do this nice? The only…
gruszczy
  • 40,948
  • 31
  • 128
  • 181
1
vote
1 answer

From Elixir to SqlAlchemy Declarative, Polymorphic Nodes with Child Inheritance

I have already finished a good bit of my python/Elixir interface on my existing database. I am now considering to drop Elixir and move everything into pure SQLAlchemy, most likely wanting to use Declarative methods. I am not sure where to even…
user2097818
  • 1,821
  • 3
  • 16
  • 34
1
vote
1 answer

Base entity with concrete inheritance

I want to have a base entity with a field deleted which marks a deleted record. And i have 2 subclasses, each of them to have their own table with all own columns: from elixir import * from sqlalchemy import create_engine class Catalog(Entity): …
warvariuc
  • 57,116
  • 41
  • 173
  • 227
0
votes
1 answer

Using Flask with Elixir and SQL alchemy

I am trying to use Elixir with Flask. Reason being using SQL Alchemy directly has me confused about the data insert on Many to Many relations. So I have created the models file and generated the tables I need. For SQl alchemy I call from flask like…
Abhishek Dujari
  • 2,343
  • 33
  • 43
0
votes
1 answer

SQLAlchemy insert millions data inefficiently

It takes a long time to finish 100000 (user,password) tuple insertions. def insertdata(db,name,val): i = db.insert() i.execute(user= name, password=val) #-----main------- tuplelist = readfile("C:/py/tst.txt") #parse file is really fast mydb…
CodeFarmer
  • 2,644
  • 1
  • 23
  • 32
0
votes
1 answer

How to order by count of many to many relation with Elixir?

Use Elixir and have two entities -- Voter and Candidate -- with many to many between them(voter can vote for many candidates if it matters). Want to get list of Candidate's sorted by amount of voters. Is there any way to do it using such Elixir's…
Andrew
  • 13
  • 4