django-orm
Django ORM misreading PostgreSQL sequences?
Background: Running a PostgreSQL开发者_如何转开发 database for a Django app (Django 1.1.1, Python2.4, psycopg2 and Postgres 8.1) I\'ve restored the database from a SQL dump several times. Each time I[详细]
2023-01-06 01:19 分类:问答Is there anything like unique_together(max_occurences=3)?
I have a model: class MyModel(models.Model): a = models.IntegerField() b = models.IntegerField() c = models.IntegerField()[详细]
2023-01-05 10:46 分类:问答Does a Postgresql dump create sequences that start with - or after - the last key?
I recently created a SQL dump of a database behind a Django project, and after cleaning the SQL up a little bit was able to restore the DB and all of the data. The problem was the sequences were all m[详细]
2023-01-04 05:47 分类:问答mutli django admins with different db databases in django 1.2 - strange problem
I am using django 1.2 to create a multi site shop. I need multiple admin logins for each shop instance, e.g.[详细]
2023-01-04 05:11 分类:问答Get number of results from Django's raw() query function
I\'m using a raw query and i\'m having trouble finding out how to get the number of results it returns. Is there a way?[详细]
2023-01-03 21:43 分类:问答Django QuerySet filter + order_by + limit
So I have a Django app that processes test results, and I\'m trying to find the median score for a certain assessment. I would think that this would work:[详细]
2023-01-03 18:49 分类:问答Django: Sum on an date attribute grouped by month/year
I\'d like to put this query from SQL to Django: \"select date_format(date, \'%Y-%m\') as month, sum(quantity) as hours from hourentries group by date_format(date, \'%Y-%m\') order by date;\"[详细]
2023-01-01 09:47 分类:问答Efficient query with Generic Relations
These are my models: class Comment(models.Model): content_type = models.ForeignKey(ContentType) object_id = models.PositiveIntegerField(_(\'object ID\'))[详细]
2022-12-31 07:55 分类:问答Django aggregation query on related one-to-many objects
Here is my simplified model: class Item(models.Model): pass class TrackingPoint(models.Model): item = models.ForeignKey(Item)[详细]
2022-12-30 14:53 分类:问答Asynchronous daemon processing / ORM interaction with Django
I\'m looking for a way to do asynchronous data processing with a daemon that uses Django ORM. However, the ORM isn\'t thread-safe; it\'s not thread-safe to try to retrieve / modify django objects from[详细]
2022-12-30 00:36 分类:问答