Questions tagged [cqlengine]

Cassandra CQL Object Mapper for Python

cqlengine is a Cassandra CQL 3 Object Mapper for Python. cqlengine is part of the Datastax python driver for Cassandra

Related links:

72 questions
1
vote
1 answer

How to increment counter column through Cassandra python-driver ORM

I`m using this python driver. How can i increment counter using ORM in correct way? Maybe smth like update(counter_value__add=1) or obj.counter_value += 1? I try to avoid this manual query UPDATE ... SET counter_value = counter_value + 1
ubombi
  • 1,115
  • 2
  • 15
  • 30
1
vote
1 answer

Cassandra. Default column value

Following example from python cassandra driver class Users(Model): username = columns.Text(index=True, required=True) user_id = columns.UUID(index=True, default=uuid.uuid4) email = columns.Text(primary_key=True, required=True) passwd…
Nikolay Fominyh
  • 8,946
  • 8
  • 66
  • 102
1
vote
1 answer

Error with Cassandra's create_keyspace_simple

I'm trying to use cassandra to connect with Meetup streaming api through kafka. cqlengine seems like that it was an separated project before and the reference code that I am using is made around that time. So before, cqlengine.management had…
user3368526
  • 2,168
  • 10
  • 37
  • 52
1
vote
1 answer

cassandra unable to create table keyerror

Im trying to create a table but get this error - keyspace = cluster.metadata.keyspaces[ks_name] KeyError: 'cqlengine' Models: import uuid from cqlengine import columns from cqlengine.models import Model from datetime import datetime from…
user1050619
  • 19,822
  • 85
  • 237
  • 413
1
vote
1 answer

cqlengine connection set_session() not handling different keyspaces

I have the following code from cassandra.cqlengine import connection #inside a flask function session = get_session_for_keyspace(keyspace) connection.set_session(session) object_list = ModelTable.objects.filter(....) But although session…
Apostolos
  • 7,763
  • 17
  • 80
  • 150
1
vote
1 answer

How do I design this cassandra model properly?

I know the title is a bit broad, but I have tried a bunch of things with different errors, so I was going to use this space to describe each of them. I have a model in datastax's python-driver below: class DIDSummary(Model): __keyspace__ =…
Ethan Brouwer
  • 975
  • 9
  • 32
1
vote
1 answer

cqlengine multilpe keyspaces

I am using cassandra from python 3.4.0 with cassandra-driver 2.5.0 (and cqlengine models) . App data are distributed in: one keyspace for management and one keyspace per user. i need to query two keyspaces: master+custom. I have coded a tiny class…
trilopin
  • 85
  • 1
  • 1
  • 7
1
vote
1 answer

cqlengine model default values and uuid

Working with cqlengine models i have found an unexpected behaviour with default_values and uuid. I am using python 3.4, and cqlengine from cassandra-driver 2.5.0. with following code: from cassandra.cqlengine import columns, connection,…
trilopin
  • 85
  • 1
  • 1
  • 7
1
vote
1 answer

DataStax Enterprise 4.6.1 / C* Pagination in Python using cqlengine 0.21.0

I am currently trying to paginate query results from DSE 4.6.1 (Cassandra 2.0.12.200) with Python and cqlengine 0.21.0. My table being queried is: CREATE TABLE tags_for_search ( village_id int, tag_prefix text, tag text, time timeuuid, …
mbeacom
  • 1,466
  • 15
  • 25
1
vote
1 answer

json type in Cassandra data model?

I am wondering if I could have json data type in the column family: My table will have a unique row key, and column name of "tweets_json" and column value of json content. How would I create such a table in CQL/cassandra or using python Driver or…
brain storm
  • 30,124
  • 69
  • 225
  • 393
1
vote
3 answers

Querying with cqlengine

I am trying to hook the cqlengine CQL 3 object mapper with my web application running on CherryPy. Athough the documentation is very clear about querying, I am still not aware how to make queries on an existing table(and an existing keyspace) in my…
Abhiroop Sarkar
  • 2,251
  • 1
  • 26
  • 45
1
vote
1 answer

AttributeError: 'NoneType' object has no attribute '_consistency' when trying to show a list from database

I want to show a list from Cassandra database and show it in a html template usgin django. when I'm trying to show data it says: AttributeError: 'NoneType' object has no attribute '_consistency' Views.py: def music_list(request): files =…
ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
1
vote
1 answer

Cassandra 2 - CQLEngine : Store Images error

I'm trying to store images in database.This is my code for get an Image : image = Image.open(...a resource on web...) imageData = StringIO.StringIO() image.save(imageData, image.format) myImage = imageData.getvalue() But when trying to store in…
ABS
  • 2,626
  • 3
  • 28
  • 44
0
votes
0 answers

how should i create table schema for product

so i want to create a table that are pointing to some row items (table) and number of row item i need to create that product pname text, pid timeuuid, instock int, req set reqno set>>, PRIMARY KEY (pname, pid) or should…
0
votes
1 answer

Insert multiple rows in cqlengine

I am stucking on insert/update multiple rows /approximately 800 rows/ to cassandra table by cqlengine. I do not want to use loop in python. I searched and find batch query. But can not use it. Please help me making batch query or give other…
Lkhagvasuren
  • 85
  • 1
  • 7