question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

New field type with custom sql conversion

See original GitHub issue

I’m using trunk and some coffee I had running with the latest 2.x from pypi is no longer working. I’m implementing a Field for postgis point geometry. My conversation function to python used

q=SelectQuery(self.model_type, fn.ST_X(value).alias('x'), fn.ST_Y(value).alias('y'))
r=q.first_row()
return r.x, r.y

I can’t get your working now. Is there an equivalent? Or a better way? If prefer to have the initial select do the conversation instead of a second select query.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
coleifercommented, Sep 18, 2019

Bro are you high? Do you english?

0reactions
tclarkecommented, Sep 19, 2019

I understand that it’s inefficient, I’m trying to figure out how to make the ORM do it in a single select and automatically populate the object. The context is something like: ` class Bar(Model): id = IntegerField(primary_key=True)

class Foo(Model): bbox = BoxField() # this is the custom field with the bbox accessor bar = ForeignKey(Bar, backref=“foo”)

tmp = Bar.get(id=my_bar_id) json.dumps(model_to_dict(tmp))

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL queries to change the column type
This article will show the way to change the data type of the columns in SQL Server 2019, MySQL Server, and PostgreSQL.
Read more >
changing datatype of the fields in custom SQL
I need to convert CLOB data type in Tableau. Is it possible using Custom SQL or initial SQL and also in CLOB there...
Read more >
Migrate custom field values for type change through SQL query?
Hello, I usually use CSV or ScriptRunner's built in script for copying custom field values, but I need to do a migration for...
Read more >
Advanced field value conversion using custom mapping types
We create a simple entity with a field $point which holds a value object Point representing the latitude and longitude of the position....
Read more >
Custom data type conversion - jOOQ
jOOQ also allows for generated source code to reference your own custom converters, in order to permanently replace a table column's <T> type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found