Tagged Questions
1
vote
2answers
22 views
How to pass one-to-many relationship to context on objects.all() lookup as iterable
I'm having trouble trying to wrap my head around this. many-to-one relationships are well documented, but I can't find an example on how to pass all of the relationships of a model.objects.all() ...
2
votes
2answers
30 views
Django ecommerce website huge product page intial load time (wait)
I'm just a starter in everything Django related so I apologize upfront for my confusing explanations. I've been trying to resolve some page load issues on a Django based website with an attached ...
0
votes
2answers
33 views
How to Dynamically Access Fields from Foreign Key in Django Admin
So I have models like this:
class Celebrity(models.Model):
#30+ fields here ...
class HoneyBadger(models.Model):
name = models.CharField(max_length=10)
celebrity_owner = ...
0
votes
1answer
21 views
Django models and relationships
I've inherited a database that has undergone a redesign which includes adding foreign key and unique constraints. Therefore, the previous tests are not valid for these models, and I'm rewriting the ...
0
votes
1answer
21 views
django contains any query
I am trying to make a query that selects all uuids of ProblemSet whose problems contains at least one problem with a specific problem type. How can I do it in Django? In mysql it will be a simple join ...
0
votes
0answers
17 views
How to customise Django admin for subclasses depending of its type?
I have a simple inheritance at one of the models
class ParentClass(models.Model):
attribute1 = models.CharField()
attribute2 = models.CharField()
......
child_type_choices = (ChildClass1, ...
1
vote
1answer
19 views
how to add a condition of comparing two fields of the model itself in Django model query
As mentioned by the title, in Django:
Say I have a model name QuestionRecord, with two fields: full_score and actual_score.
I want to realize the SQL:
select * from QuestionRecord as QR where ...
0
votes
3answers
45 views
Creating multiple instances of a model from another model?
How would I create multiple instances of a model from another model related by a foreign key? Example code below:
import itertools
class Table(models.Model):
color = ...
0
votes
1answer
37 views
Postgresql performance and Django
My question is something in general as I am looking for a suggestion on the best way to work with a query on PostgreSQL with the characteristics:
Interval from client side of 5 seconds
More than ...
0
votes
1answer
25 views
How to associate some value in model with ForeignKey?
I have two models: Product and Currency.
class Product(models.Model):
Currency = models.ManyToManyField(
'Currency', verbose_name=u'Currency', blank=True, null=True)
class ...
1
vote
0answers
42 views
Using pytables and pandas with Django [closed]
Does anyone know of a good way to use pytables with the Django as a datastore (mainly reading data)? I am hoping to store large amounts of log data using pytables and then access it in my django app ...
1
vote
2answers
19 views
Translate Django model fields without having a default language
I'm currently using django-transmeta in order to translate some model fields, but now I have a big problem, as it is too restrictive for me.
In transmeta you define a default language and then you ...
0
votes
0answers
26 views
Retrieve all related records using values_list or similar
I have 3 Models: Album, Picture and PictureFile, linked by Picture.album and Picture.pic_file
I'd like to do something like the following, and end up with a list of PictureFile records:
pic_files = ...
0
votes
3answers
38 views
Date ValidationError in Django [closed]
I want to block users whose premium plan has expired after 30 days(though I might change the days later). And redirect them to the payment page. I'm doing this by checking the db if the expiry date ...
0
votes
2answers
18 views
django max folders number per user
I was thinking "Enterprise" :)
In my Django 1.5 project if I will reach the maximum ext4 number of folders
ext3: 31998* and
ext4: 64000
And as far as I know with 63.999 folders there are problems, ...