> On Sat, Nov 22, 2008 at 2:38 AM, Chris <[EMAIL PROTECTED]> wrote:
>> Hello everyone,
>> I have a quick python question. Is they a better way of calling a
>> method dynamically then what I have below? Is there a more elegant
>> approach? Thanks in advance.
>>
try:
self.__class__.__dict__[met
> I think the effect you are seeing is more of MySQL thing than a Django
> thing, so that is where I'd be looking for a better idea of what the server
> is doing to speed up subsequent queries like this (in fact I think I recall
> reading about it at some point in reading up on MySQL, though I don
We have a modelformset created like this:
DocumentFormSet = modelformset_factory(Document, extra=0,
fields=('name', 'category')
with a models.py like this:
class Category(models.Model):
name = CharField(max_length=100)
# other stuff
class Document(models.Model):
name = CharField(max
> EC2 m1.small instance, talking to another m1.small instance hosting MySQL db
>
> DB performance doesn't seem to be the issue - I don't see the DB server
> under any load at all.
What sort of network latencies are you seeing? Are they hosted in US-East-1?
http://alan.blog-city.com/has_amazon_ec2
> Yes, hosted in US-East-1, but I was running benchmark tests from another EC2
> instance in the same region, so reasonably sure it's not latency.
I meant latencies internal to EC2; eg. what is your ping time between
the frontend and the DB box? The article I linked to reports that this
has been o
> Has this happened by default or by design? Is mysqldb really that much
> faster, or featureful, or just because it's more common?
>From http://forge.mysql.com/projects/project.php?id=302
"Development Status: Early (Pre-Alpha)"
--
steve
--
You received this message because you are subscribe
> Can anyone give me idea how to provide graphs in Django.
Assuming you mean "graph" in the "graph theory" sense, then NetworkX
(http://networkx.lanl.gov/) is a mature graph library for python.
--
steve
--
You received this message because you are subscribed to the Google Groups
"Django users
Instead of
> test.py:
>
> "
> from mod_python import apache
>def index(reg):
> retutn "test successful!"
> "
>
Try:
"
from mod_python import apache
def index(reg):
return "test successful!"
"
Note that there is no space preceding the 'def'. Indentation is meaningful
in p
> Is it possible to drop a Python script (around 50 lines) into one of your
> django pages? Would this be embedding into the template code?
You could wrap it in a custom template tag:
https://docs.djangoproject.com/en/1.3/howto/custom-template-tags/
--
steve
--
You received this message becau
Firstly (and I don't think this is the cause of the problem) you're
calling datetime.now() four times, which will give you four different
datetimes (ie. the queries will not be completely identical). Secondly
SQL uses a 3-valued logic (with null) so if any of the fields you're
filtering on are null
> So, if one of the fields can be Null, then *neither*:
>
> queryset.filter(field=value)
>
> queryset.exclude(field=value)
>
> will match a record where it's Null?
As I understand it, this is correct - it's certainly the way SQL was designed.
> In that case, is there a better - more relia
Perhaps I'm not sure exactly what you mean by "more general", but I
was recommending something like
red_things = queryset.filter(Q(color="red"))
non_red_things = queryset.filter(~Q(color="red") | Q(color__isnull=True)
This will produce SQL like
SELECT * FROM queryset WHERE color IS 'red';
SELECT
Unlike some of the other methods in PIL "thumbnail" modifies the file
in place and returns None. This will probably do what you expect:
import Image
ARTICLE_LARGE_SIZE = 230,300
tmp_file = Image.open(form.cleaned_data['image'])
tmp_file.thumbnail(ARTICLE_SMALL_SIZE)
tmp_file.save(location + '/smal
There are a number of ways to do this, but the most popular I think is
MathJax. There is a django app for assisting with it's integration here:
https://github.com/kaleidos/django-mathjax
On 12 August 2014 07:51, sandy wrote:
> Hi,
> I want to include a mathematical equation in django project. C
Hi Crohn.
You're asking a lot of related but very general questions here. I know
you are looking for someone who has "had the same problem" but we
don't know what your problem is. The whole point of any architecture
is that it's supposed to be a solution to your problems, not a problem
in itself :
15 matches
Mail list logo