The problem turned out to be an bug with an custom manager class based on
djorm_pgfulltext search mixin. I'd found an issue with it last week, and
patched in the development environment but forgotten to patch the other
machine.
--
You received this message because you are subscribed to the
I've got a weird one I just can't figure out. I'd love some help while I'm
still sane.
On my development machine all is well. On the other machine the database
router seems to be getting the parent class (which is an abstract model in
another app). I determined this with some print statem
I'm not clear on your question. I can't tell if you are wanting to allow
them to edit the site layout (templates) or content that happens to contain
html? Either way, you might look into using the Ace javascript based code
editor http://ace.c9.io/
If you are talking about letting them modify
There have been small, well thought out changes over the last 4 years but
fundamentally most still remains pretty much the same. I have several
installs running an patched old .96 version, as well as newer stuff with
later versions. It all feels about the same to work with. I recently
upgr
I was waiting on Christmas dinner, and had an hour to kill so I threw
together a quick, incomplete skeleton app. Maybe it can be of use to get
you started on the django side. It relies on the django-macaddress
package, but is otherwise standalone. It's very basic - the less there is
of it,
I can't recommend either of those solutions specifically, but I have been
using an approach similar to that of django-multisite running on a threaded
fastcgi instance since django .96 days and it has worked well for us. My
main concern would be with third-party apps that set static data initial
Celery is a good option, and probably the most used. There are a couple
of other options that may be worth looking into:
Huey
https://github.com/coleifer/huey
Rq
http://python-rq.org/
Personally I've never gotten on well with celery. It's just not at all
intuitive to me (it's heavy use of d
A suggestion: Make the return arrow from views more clearly indicate that
return path goes through the middleware (since it passes through once as a
request, and back through the middleware in reverse with the response) and
back through the webserver layers. I'm probably asking for a lot, but i
On Saturday, June 29, 2013 11:32:19 PM UTC-5, Harjot Mann wrote:
>
> Is there any search query in django which can ignore vowels like I want to
> make a query which displays all the clients name who writes their name as
> 'amanjit' or 'amanjeet'.
> It should take take ee=i or anything like thi
I'm guessing it is a result of not having a csrf token set for the
post:
https://docs.djangoproject.com/en/dev/ref/contrib/csrf/#ajax
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups
It seems to me that two fields might be the simple solution?
class SomeForm(Form):
internal = forms.ModelMultipleChoiceField(
,
widget=forms.CheckboxSelectMultiple)
externa = forms.ModelMultipleChoiceField(
,
widget=forms.CheckboxSelectMultiple)
Then y
I should have looked a little harder, I found the blog post. It is
about a much older version of Django. Some of the references to django
internals are surely a bit different now, but the fundamentals are the
same. It really helped me when I first started. I'd love to see it
updated for the curre
http://www.twistedcommons.com/2008/12/how-django-works.html
There was a blog post several years ago that followed, in detail, the
life of a response with all the gory details. Unfortunately I can't
locate the link. The above page is brief, but has a nice picture that
is easy to follow.
A huge d
I don't think anyone will be able to give you a good evaluation
without knowing more about the requests. Django itself could probably
handle 10k requests per second returning a simple "hello world"
response, or less than 10 if you are returning very large/difficult to
generate responses. It is wh
You might also try a different scripting language, for example Lua.
I've a python module "lupa" bookmarked for a project on my todo list
that requires user scripting. It appears you can have a relatively
sandboxed access to python objects. I'm hoping that with some careful
compiling of the luajit
There are a few choices that I'm familiar with.
1) Create a separate project/settings file for each of your stores,
overriding templates as needed by placing assigning a template path
for the project. I think this is pretty much the recommended way to
do things, especially if the number of sites
> Doug, I don't see how the LazyFetch you wrote is much different than
> what akaariai shared? Can you explain to me what the difference is?
> And I'm not saying that in a condescending way, I'm saying I'm just
> not sharp enough on my Python to recognize the difference.
Slightly different impleme
I made an error when I changed a variable name just before posting.
Replace "self._age" with "self._last_updated".
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe
A method similar to what Anssi describes is what we use for local
caching of data that is too large to comfortably fetch from cache/
parse from file every time we need it. A Doing a lazy fetch with a
maximum age like that also helps with load times since it is only
fetched when accessed. Of course
If you have a dataset that is too large to fit in memory comfortably,
the ability to pass a generator to an httpresponse means you can break
it up into multiple smaller queries (outside the template system
anyway):
def queryset_to_csv(queryset,delimiter=',',steps=500):
""" generator for large
Just to clarify that last bit about a mapping on the model since it's
closest to what you originally described. Just pseudo-code, but you
can see the idea.
class Model1(models.Model):
FIELD_DISPLAY={
'foo': ['a'],
'bar': ['b','c']
}
a = models.CharField()
b = models.Foreig
I may not be clear on what you are trying to accomplish, but maybe
something like
class Form1(forms.ModelForm):
class Meta:
model=Model
def type_one_fields(self):
return [self.fields['a']] # Or use whatever criteria you want
for type_one fields.
def type_two_fields(sel
There are also a few third-party apps that can assist you with the
form->query process such as this one:
https://github.com/alex/django-filter
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@goo
Another clarification: It tells django to create an index on that
field when you run syncdb to create the tables for your apps. Adding
it to an existing model won't change anything by itself. If you
decide a field needs an index you can add it to the model definition,
and then you can use the "m
I would agree with Donald, and expand on that to say that an installer
would probably be best written in php for widest compatibility. A php
based installer would run outof the box on most webservers, and be
able to give a guided overview of the python/web environment setup.
It would easily be abl
The most elegant way I've seen specialized form rendering handled was
the use of template tags and filters. The django uni-form project is
a good example. By using the filter and template tags you gain full
access to all the form elements, and can do easy manipulation in
python, but leave the ren
Can you use the filesystem loader as the first template loader, then
set TEMPLATE_DIRS in settings.py to specify a template directory
outside any app? Use this location for all of your overrides, just
make sure the path is right... ie each app you override would have its
own subdirectory.
--
You
I haven't moved to 1.3 yet, but we do a few things with the template
source too so this is definitely of interest. It looks like most of
the template loaders define a load_template_source method
implementation that does return the source, except for the cached
loader. As a work around you could a
You probably don't want to cache changes. Or if you do, it would be
better done elsewhere (like a caching raid controller/w battery on
your database machine). The usual cache patterns I've seen are:
1) Fetch from database
2) Store in cache with a reasonable timeout to that changes are
reflected
Depending on the resolution and maximum duration, you could just use
an integerfield containing either the number of seconds or minutes,
and then recreate it. That way you can also base queries off of the
value, which you can't do with just a pickle field. Of you could
subclass the integerfield a
I'd like to see you model structure, but based on what I think it is:
class Entry(model.Model):
categories=models.ManyToManyField(Category)
class Content(models.Model):
entry=models.ForeignKey(Entry)
You have a Content Instance
You want to see other entries belonging to one or more of th
I don't think it's necessarily a choice between learning php or
learning python. Most programming languages are fairly similar in
concept, and once you've mastered one it's reasonably easy to pick up
a new one. Python is a great language, but I think it's especially
great as a first language. You
I'll second the use of something like LXC (new to me) or OpenVZ (what
we use), allowing you to run/test multiple distros at once. If you
want to try debian (or pretty much any linux distro), download a
container skeleton for it and install in a few seconds. I've used
virtualbox/kvm, but I found c
def main(request):
context=Context()
this_is_the_template_object = loader.get_template("main/
start.html")
this_is_the_template_rendered=this_is_the_template_object.render(context)
return HttpResponse(this_is_the_template_rendered)
What you are feeding HttpResponse is the object
**filters is python for expand the dict 'filters' into keyword
arguments.
ie
filters={'foo':1}
model.objects.filter(**filters)
is the same as
model.objects.filter(foo=1)
The filters variable is just temporary dictionary for building the
keyword arguments from the form data, electing to omit any
If you just want a simple user search (which seems to be what you are
asking for), it really depends on your models - but a basic approach I
usually use is to define a django form to use for the search, and
instead of defining a save method, make a method that returns a
queryset. As an off the top
For our setup we created a separate user,site framework since we do a
form of vhosting that serves multiple sites from one instance. We have
a Site model that serves as the root tying all of our other models
together. No abstract models or anything fancy, just a FK in each
model class pointing bac
I actually authorized, but got a little creeped out by being asked for
three cities in which I'd lived before being able to continue. I
entered one, but it still wouldn't let me pass without another two. I
couldn't conceived of ANY legitimate reason to need anything more than
my current location
Everyone has different requirements, but I'm one of those strange
people who don't care about having a powerful editor. I don't want
completion, or auto-anything. Just something that gets out of my way
and lets me work. If something complex needs to be done on occasion,
that's what the shell and
Could you do a ManyToMany relationship through an intermediary model,
and then query the intermediary using select related?
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To un
Have you done any performance testing? From what I understand pythons
re.compile caches internally, so after the first call subsequent calls
will use the pre-compiled expression. Serializing the compiled
expression using pickle isn't 'free', so I'm wondering how much
difference there is in practi
Thank you! I've been wishing something like this was a part of Django
since trying to write my first tag. I've been using something in
house that provides similar functionality for a couple of years and
couldn't live without it. Your implementation is much more complete
(validation) and I'm look
The reason I chose django in the first place was the documentation.
Compared to everything out there, it was incredible. Back then it
also had a helpful comments section on each page where people chimed
in to clarify various parts of the document. It reads like a text
book, which is a big help wh
@ringemip
Thanks for the reply. I've been considering something like that, but
given the number of views and tags involved, it would be a very long
process. Especially since I used a new context instance in most of my
custom tags that render another template, rather the pushing,
rendering, poping
First, I'd like to find out if there is a better way than thread
locals to do what I want to do. From what I can tell, it isn't
possible any other way. Finally, I don't understand why my thread
locals implementation/hack works - which scares me, so I would like to
ask the wiser gurus out there f
45 matches
Mail list logo