I am doing geolocation, and Django does not have a PointField. So, I am forced to writing in RAW SQL. GeoDjango, the Django library, does not support the following query for MYSQL databases (can someone verify that for me?)
cursor.execute("SELECT id FROM l_tag WHERE\
(GLength(LineStringFromWKB(LineString(asbinary(utm),a...
Django currently does not support the "Point" datatype in MySQL. That's why I created my own.
class PointField(models.Field):
def db_type(self):
return 'Point'
class Tag(models.Model):
user = models.ForeignKey(User)
utm = PointField()
As you can see, this works, and syncdb creates the model fine.
However, my curr...
after calling JetSetColumns() and then JetUpdate() how do I retrieve the values for any freshly assigned autoincrement values?
...
I'm trying to find rows which are within __meters from the given point.
THis can be done via distance or overlap.
WHat is faster?
...
Are soft deletes a good idea or a bad idea?
Instead of actually deleting a record in your database, you would just flag it as "IsDeleted" = true, and upon recovery of the record you could just flag it as "False".
Is this a good idea?
EDIT: this might be a better idea??? what about physically deleting the record then moving it to a ext...
Suppose I have a datetime column.
"SELECT * FROM mytable WHERE thetime < INTERVAL 1 HOUR"
How do you write this in Django?
...
class LocationLog(models.Model):
user = models.ForeignKey(User)
utm = models.GeometryField(spatial_index=True)
This is my database model. I would like to insert a row.
I want to insert a circle at point -55, 333. With a radius of 10. How can I put this circle into the geometry field?
Of course, then I would want to check whic...
How can I make Quartz to reschedule its job automatically, when I directly modify the CRON_EXPRESSION value in the QRTZ_CRON_TRIGGERS table?
...
newthing = Link(user=request.user,last_updated=datetime.datetime.now())
However, this uses datetime , not the MYSQL "now()".
How can I use mysql's now()?
...
I'm investigating technologies with which to develop a medium-scale (up to 100 or 200 simultaneous users) database-driven web application, and someone suggested Morfik. However, outside of the Morfik company I can find practically zero community support - no active blogs, no tutorials, no videos, no books - and this is of some concern (e...
There's a field with type of varchar. It actually stores a float point string.
Like 2.0 , 12.0 , 34.5 , 67.50 ...
What I need is a update statement that remove the ending zeros of fields like 2.0 , 12.0 , change them to their integer representation , that is 2 , 12 ...,and leave 3.45 , 67.50 unchanged . How should I do this ? I am using ...
| time_before | datetime | YES | MUL | NULL | |
| time_after | datetime | YES | MUL | NULL | |
the_tag = Tag.objects.get(id=tag_id)
Log.objects.filter(blah).extra(where=['last_updated >'+the_tag.time_before, 'last_updated' < the_tag.time_after])
Ok. Basically, I have an object that's ca...
Hi, I am currently planning to develop a music streaming application. And i am wondering what would be better as a primary key in my tables on the server. An ID int or a Unique String.
Methods 1:
Songs Table:
SongID(int), Title(string), Artist*(string), Length(int), Album*(string)
Genre Table
Genre(string), Name(string)
SongGenre...
Hi,
I am looking for the MySQL equivalent of CONTEXT_INFO that is present in SQL Server. Or any other session variable like thing using which I can pass the username to the trigger.
I am currently working on logging table data for audit. I need to pass the username of the logged in user to the delete trigger.
Any ideas? We are deletin...
Hi,
I'm currently working on an C#/ASP.NET project that will host several differents e-commerce websites, all running in the same application.
I use LinqToSql (moving to PLINQO soon) to access my database. The database contains both informations on the website structure (pages, ...) and the products/orders/users data.
My question is,...
Hi,
I have a DB on oracle on Windows Server 2003. How do I export it with all the data and put it into other Windows server?
...
I'm trying to put all our databases in TFS. For this purpose we're using TFS Database edition - I've seen some of the other Dev teams use it and it seems pretty good.
Problem is that it doesn't seem to script the logins - the users are linked to logins which now break due to the logins not being scripted.
As far as I can tell I can't ...
We are in the middle of changing web store platform and we need to import products' data from different sources.
We currently have several different csv files from different it systems/databases because each system is missing some information. Fortunatly the product ids are the same so it's possible to relate the data using ids.
We n...
I have 2 tables that their rows have one on one relation..
For you to understand the situation, suppose there is one table with user informations
and there is another table that contains a very specific informations and each user can only link to one these specific kind of informations ( suppose second table as characters )
And that cha...
I notice most of the discussions about Blackberry database options are old, and generally not too informative.
As of today, March 31st, 2010, what is the best, most universally supported, free database option available for Blackberry developers?
I heard SQLite is available for JDE v5, but last I checked, that was still in beta, and I d...