I've done something similar to this, putting the site language in the
url.
Basically you create a middleware process_request, that will take
request.path and set it to something else.
For example you might do:
request.path = "/app/theme/view/"
parts = request.path.split("/")
request.path = "/
I'm absolutely stuck on this. This question might be more python than
django related, but I figured because it deals with Amazon S3, someone
here may know how to handle it.
Here's what needs to happen:
1. A user uploads an image (part of a Model we have)
2. Create a 100x100 thumbnail using PIL
On Wed, 2007-05-30 at 10:58 -0400, Jason McVetta wrote:
> On 5/29/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> Or you could subclass DatabrowseSite -- in your own code
> somewhere; no
> need to even modify the source -- and override the root()
> method to do
On Wed, 2007-05-30 at 08:31 -0700, ringemup wrote:
[...]
> > So a "uniqueness" constraint on your model is not something that the
> > form framework is really in a position to check. Instead, what should
> > happen is you construct the model object and then call
> > object.validate(), which return
>What is the proper way to import modules within an application ? For
>example if I have a project "foo" containing an application "bar",
>how should I import things in bar's modules ?
Great question! This is a problem that I've thought about as well. I am
very interested in what more experience
On Wed, 2007-05-30 at 22:48 +0200, Nicola Larosa wrote:
> David wrote:
> > The second reply asked "Why switch?" There's no smoking gun or nasty
> > occurrence, but we're switching some applications from Oracle to open-
> > source databases and are trying several. Because we need to interact
> > bo
On Wed, 2007-05-30 at 21:49 +, [EMAIL PROTECTED] wrote:
> On May 24, 12:04 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
> > Your form-level clean method should run through all of its validation,
> > collecting the errors as it goes and then raise a ValidationError. Note
> > that Vali
On Wed, 2007-05-30 at 15:47 -0700, will_o0o wrote:
>
> I'm installing django with mysql and was getting the cryptic
> message...
>
> "Skipping validation because things aren't configured properly."
>
> It turned out there's a bug in the mysql python wrapper (MySQLdb) for
> version 1.2.2. The mo
On Wed, 2007-05-30 at 23:40 +0200, Bram - Smartelectronix wrote:
> Hey everyone,
>
>
> I was thinking that I'd like to know if there is a standard way of
> transforming a newforms reply to JSON (or anything else).
>
> I'd like to think it would be easy to have a new-form, submit it via
> JSON
On 5/30/07, Luper Rouch <[EMAIL PROTECTED]> wrote:
> 2. import bar.module
> the application is more portable, but its path has to be included in
> PYTHON_PATH (at least under mod_python)
I generally opt for this one, but with one caveat: I almost *never*
place applications directly inside the pro
Hi list,
What is the proper way to import modules within an application ? For
example if I have a project "foo" containing an application "bar",
how should I import things in bar's modules ?
1. import foo.bar.module
the source code has to be modified when using bar in another project
2. imp
I'm installing django with mysql and was getting the cryptic
message...
"Skipping validation because things aren't configured properly."
It turned out there's a bug in the mysql python wrapper (MySQLdb) for
version 1.2.2. The module tries to import "ImmutableSet" from sets.py.
The solution is t
Chris Kelly wrote:
> I am in the process of writing an app that will have a "theme" based
> on if a subdirectory is specified e.g.:
>
> http://somesite.com/app/(theme)/abunchofviews/
>
> basically, if they go to /app/bluetheme/register, it'll give them a
> registration page with a blue theme heade
On May 24, 12:04 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Your form-level clean method should run through all of its validation,
> collecting the errors as it goes and then raise a ValidationError. Note
> that ValidationError can take a list of error messages in its
> constructor, so j
Xin Xic wrote:
> Well, I want out a form for a human verification with an image and an
> input field. But I don't know how is the best practice for make this.
> How do you do it?
Try: http://smileychris.tactful.co.nz/ramblings/recaptcha/
de res,
- bram
--~--~-~--~~~
direct_to_template sounds like a nice way to handle the index page
serving.
But how can it be fed the dynamic content of one or more apps to
display? Not sure how it's supposed to be done
through "template tags" as Michel mentioned.
On May 24, 5:42 pm, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> w
> I have a question about filtering queries concatenating fields.
> I just saw in documentation the possibility to concatenate (AND, OR)
> sentences, but not concatenate table-fields to filter something. Is
> the Django DB-API able to do something like that?
>
> [SQL]
> WHERE lower(table1.label |
Hey everyone,
I was thinking that I'd like to know if there is a standard way of
transforming a newforms reply to JSON (or anything else).
I'd like to think it would be easy to have a new-form, submit it via
JSON and be able to -automatically- display the errors, as if you would
just have ca
I was trying to use limit_choices_to in what I thought was an intuitive
way.
class Organization(models.Model):
members = ManyToManyField(User)
class Committee(models.Model):
org = ForeignKey(Organization)
chair = ForeignKey(
User,
limit_choices_to={ 'organizat
Fixed! I tried putting the contents of my previous templatetags in
another directory and it worked. Seems silly, though. Anyhow, now I
have:
project/templatetags/__init__.py
project/templatetags/templatetags/__init__.py
project/templatetags/templatetags/general_tags.py
Also, in case anyone cl
I'm having my first go at a generic templatetag and am having issues
getting it to work.
I've created a directory at project/templatetags, which contains
__init__.py and general_tags.py
I've added project.templatetags to my INSTALLED_APPS in settings.py
general_tags.py looks like this (it's just
Hi,
I have a question about filtering queries concatenating fields.
I just saw in documentation the possibility to concatenate (AND, OR)
sentences, but not concatenate table-fields to filter something. Is
the Django DB-API able to do something like that?
[SQL]
WHERE lower(table1.label || ' ' ||
David wrote:
> The second reply asked "Why switch?" There's no smoking gun or nasty
> occurrence, but we're switching some applications from Oracle to open-
> source databases and are trying several. Because we need to interact
> both via Django applications and via direct SQL, we have been findin
My solution is to use the base class parameter of form_for_[model|instance]
function, for example:
class SomeTest(models.Model):
name = models.CharField(maxlength=50)
user = models.ForeignKey(User)
class Meta:
unique_together = (('user', 'name'),)
class SomeTestBaseForm(forms.Base
I am in the process of writing an app that will have a "theme" based
on if a subdirectory is specified e.g.:
http://somesite.com/app/(theme)/abunchofviews/
basically, if they go to /app/bluetheme/register, it'll give them a
registration page with a blue theme header and footer (it looks up a
th
On May 27, 8:38 am, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote:
> On Tue, May 22, 2007 at 06:56:31AM -0700, [EMAIL PROTECTED] wrote:
> > And there are no best practices for using something as inherently
> > inaccessible and annoying as a captcha.
>
> So, what are the best practices to check wh
I have the luxury of not allowing anyone to submit much of any form
unless they're registered and logged in. If that's not an option, I
think the simple question/response checks are best.
On May 27, 7:38 am, Baurzhan Ismagulov <[EMAIL PROTECTED]> wrote:
> On Tue, May 22, 2007 at 06:56:31AM -0700,
[EMAIL PROTECTED] wrote:
> Oh..I meant to mention that this is using the default
> ChangeManipulator for the class.
Then set to the field 'editable=False' and manipulator won't touch it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Oh..I meant to mention that this is using the default
ChangeManipulator for the class. If I specify the delete_flag in the
non_fields as zero, it of course works...but I'm adding this flag in a
lot of places... so I'd prefer that it just stay as 0 w/out me
specifiying it in the non_fields list fo
I have a field:
delete_flag = models.IntegerField(null=False, blank=True,default=0)
When I save it initially, the delete_flag is set to 0, but if I edit
it, and don't specify the delete_flag value, it seems to be getting
set to NULL anyone have any idea why?
Thanks for any information,
Caro
On May 23, 2:51 am, Robert Coup <[EMAIL PROTECTED]>
wrote:
> Rob Hudson wrote:
> > Cool. What's the best way to coordinate the effort? A wiki page to
> > start with?
>
> Current trends seem to be to use Google Code for projects that aren't
> likely to become part of the core django distro. A l
ringemup wrote:
>
> Do you then have to figure out which errors apply to which Form
> fields, and sort them out and assign them? I haven't seen any sample
> code doing anything of this sort, so I'd be very interested to see how
> it works.
>
I was recently in the same situation and did somethi
> The short answer to your problem is probably to not use form_for_model()
> if you want this sort of support. Instead write your own Form sub-class
> and write a clean() method for it. The form_for_model() function is just
> an aid after all; it shouldn't be the only thing you ever consider
> us
I was kind of wondering the same... is the Django Book going to align
with Django 1.0?
--~--~-~--~~~---~--~~
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@googlegr
Hi Malcolm!
On Sat, May 26, Malcolm Tredinnick wrote:
> On Fri, 2007-05-25 at 17:17 +0200, Michael Radziej wrote:
> > First, I found that I have a problem with commit 5255 together with the test
> > client. It breaks loading the modules, probably due to recursive imports.
> >
> > - management ac
On 5/29/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
>
> Or you could subclass DatabrowseSite -- in your own code somewhere; no
> need to even modify the source -- and override the root() method to do
> an auth-check first and then call DatabrowseSite.root(). Then you
> replace databrowse.site
On 5/30/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote:
>
> On Tue, 2007-05-29 at 21:38 -0400, Todd O'Bryan wrote:
> > Template error
> > In
> > template
> > /home/tobryan1/workspace/dmi/src/dmi/orgs/templates/obligationList.html,
> > error at line 18
> >
> >
> > Caught an exception while rendering:
On May 24, 2:06 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> The unicode branch, [1], is now at a point where it is essentially
> feature-complete and could do with a bit of heavy testing from the wider
> community.
>
> So if you have some applications that work against Django's current
>
Cheers for the heads up
On 27 May, 15:52, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 5/23/07, mikeyparker <[EMAIL PROTECTED]> wrote:
>
>
>
> > I'm just moving an application that we were writing over to the
> > GeoDjango branch
>
> FYI, I'm woefully behind on merging that branch up to trunk.
On May 25, 5:56 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I'm trying to write a view to return a list of blog entries associated
> with a specific tag (using the django-tagging app).
You can do the following to get a BlogEntry QuerySet for the
appropriate entries:
TaggedItem.objec
Great, works nicely.
I would have a follow-up question though :)
What about QuerySets?
Could I do:
p = Poll.objects.get(viewer=request.user,pk=poll_id)
and get that viewer parameter passed via QuerySet to the model?
Thanks, Sebastjan
On 5/29/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
On May 30, 3:09 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> Everything is ready (you can see all the pieces that were ported over in
> the "TODO" list on the UnicdeBranch wiki page). Syndication has
> definitely been tested with non-ASCII content, so it should also work.
> Any failures a
On Tue, 2007-05-29 at 21:38 -0400, Todd O'Bryan wrote:
> Template error
> In
> template
> /home/tobryan1/workspace/dmi/src/dmi/orgs/templates/obligationList.html,
> error at line 18
>
>
> Caught an exception while rendering: 'ManyRelatedManager' object is not
> iterable
>
> 18 {% for obligati
hey thanks chrominance for real good helping stuff.
i was not looking at the last line which clearly states that
argument 1 must be string or read-only buffer, not long
your return HttpResponse(str(uu.id))is really helpful
and also thanks for get() and filter(). i'll keep that i
> return HttpResponse(user.id) #just to test
>
> it returns error
> MOD_PYTHON ERROR
> TypeError: argument 1 must be string or read-only buffer, not long
> besides all that long error page
That's because HttpResponse expects a string (or read-only buffer) and
you've provided
Am Dienstag, 29. Mai 2007 21:19 schrieb ringemup:
> Hello --
>
> I'm using a basic form_for_model() form object for a model that has a
> unique=True constraint on a field other than the primary key.
>
> When validating submitted data, is there a reason the form check that
> that constraint hasn't
46 matches
Mail list logo