Tagged Questions
0
votes
0answers
39 views
Django Celery Task for all objects in model with datetime operations
Hi I created quite important piece of code. But I am not pretty sure is it good enough.
Description:
I have big task for database and decided to use django-celery. I want to go through all objects ...
2
votes
1answer
154 views
faster Django csv generation on the fly
I am writing a csv file generator that's filtering through about seven million db entries. {mySQL backend} This part is especially slow and I was wondering if there is a way to make it much faster. I ...
-1
votes
2answers
67 views
Unpacking sequences for functions
After watching Raymond Hettinger, I decided to go through my code and make it faster and more beautiful. The example given on the slides is, unfortunately, not good enough to get me going (ref. ...
3
votes
1answer
122 views
Python/Django Script - Is it crap? Objects duplicated or passed?
I've written a script using the Django ORM to store 'configuration settings' and interacting with the Google Drive API and another API. The script creates a base project folder and subfolders in ...
1
vote
1answer
68 views
POST data handler
I have written a function to handle post data received from a web page. The Emphasis is on making getting post data easy: using the function allows the coder to specify the required data, type, and ...
1
vote
1answer
72 views
Django how to make this view faster?
I have view and it works correct, but very slow
class Reading(models.Model):
meter = models.ForeignKey(Meter, verbose_name=_('meter'))
reading = models.FloatField(verbose_name=_('reading'))
...
3
votes
1answer
160 views
Feedback on a small Python parser
I'm working on a feature for the HamlPy (Haml for Django) project:
About Haml
For those who don't know, Haml is an indentation-based markup language which compiles to HTML:
%ul#atheletes
- for ...
2
votes
1answer
128 views
Need advice of refactoring views.py
I setup simple CRUD in Django
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.urlresolvers import reverse_lazy
from django.http import ...
2
votes
3answers
63 views
Building and getting a form of objects that have multiple properties
I'm building a form dynamically in a web app where I'm using product_id to keep track which product I'm reading and then product_<id>_property to grab the value of it. Then in my view I end up ...
1
vote
2answers
69 views
Doubts about db_index, primary_key and unique parameters
I'm trying to improve my code. I've some doubts about db_index, primary_key and unique parameters.
# -*- coding: UTF-8 -*-
from django.db import models
from django.contrib.auth.models ...
3
votes
1answer
175 views
Am I being too redundant in this Django view (or can I reduce the repetition in my code)?
I'm new to Django and learning my ways around it. I'm writing a fake basic CRUD app to get me started. In the following code I pretty much copy and paste the same code four times with minor ...
3
votes
1answer
207 views
Polymorphism in Django models
For flexing my newly acquired Django & Python muscles, I have set up to do a mobile content delivery system via Wap Push (Ringtones, wallpapers, etc), old fashion but it is an exercise!
I have a ...
3
votes
2answers
200 views
Is this a good python design?
I'm using django and i wrote this decorator to take away some of the repetitive code i found for ajax views and i want to know your opinion (too basic, bad design, try this instead, ok, etc).
def ...
1
vote
1answer
214 views
Can you review my i18n/Jinja2/python code?
I'm learning to Jinja2 and what's important in this case isn't speed but i18n translations and functionality. With python 2.7 Jinja2 and not django seems to preferred way to go so I'm rewriting much ...
-1
votes
1answer
434 views
Can you review 1 line of code here?
Hi I hope you can comment when I include the largest file of my largest project. There is more available if you feel like code review. I think my project needs daily code review for some time. The ...