Hi,
I want to display a list of items by using {% for item in items %}.
To make the web pages look better, I want to use two kinds of
alternatively.
E.G item
item
My question is how can i use the tags to implement this requirement?
Any build-in tags for this?
Thanks in advance,
On Sat, Nov 1, 2008 at 12:51 AM, Xian Chen <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I want to know whether Django support alerting the tables automatically
> while I modify the models or not.
>
> Suppose the website has run a long time and stored lots of data. In this
> case, the administrator
On Oct 31, 7:05 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> My guess is that you need a trailing slash here. Without it, the
> urljoin() function doesn't know 'reports' is a directory, so it
> strips 'reports' out and replaces it with the path from the database.
> This is why your
On Fri, Oct 31, 2008 at 8:29 PM, pk <[EMAIL PROTECTED]> wrote:
> Am I missing something? Should that mechanism be refactored so that it
> can be used for user applications? Is there a better way to do
> application level configuration -- i.e. for app designed to be
> distributed and reused?
If
Hi All,
I want to know whether Django support alerting the tables automatically
while I modify the models or not.
Suppose the website has run a long time and stored lots of data. In this
case, the administrator wants to modify the model to add/remove some
properties. Does the corresponding
I'm a little confused as to the purpose behind the question, it feels
pretty general, so I have a few questions.
1. When you say application are you talking about django apps generated via
the "manage.py startapp" command?
2. LazySettings allows for a "proxying" of the Global settings in your
On Fri, Oct 31, 2008 at 11:46 PM, nkulmati <[EMAIL PROTECTED]> wrote:
>
> Hi all:
>
>
> How to modify field error wording ?
> Please do not send me to the page "Form-subclasses-and-modifying-field-
> errors" in the docs.
>
> All I need is to override the error messages, NOT the validation
>
If you know the length of the string that you want to cut off the
beginning, you could use slice:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#slice
Really, though, you might be going about this in a strange way. It
might be better to use the url tag to get the correct URL that
Hi all:
How to modify field error wording ?
Please do not send me to the page "Form-subclasses-and-modifying-field-
errors" in the docs.
All I need is to override the error messages, NOT the validation
system. That page does not address this need for some reason! I don't
want to start
There are always needs for application level configuration settings. I
really like the way settings.py works, with a package (django) level
default settings overridable by local settings. However looking at the
whole LazySettings setup it is not easily used outside of django/conf.
Am I missing
I have a standard Django installation without any changes in the
settings (except adding mysql db to the settings.py) and I'm sending
the message to localhost:8000, so there is no proxy or anything else
in the way. Still, the request body comes after me sending the
response...
On Fri, Oct 31,
2008/10/31 [EMAIL PROTECTED] <[EMAIL PROTECTED]>:
>
> Hello,
>
> I'm new to Django and it's taken me a while to get things setup
> correctly on Dreamhost. I've done the tutorials on my local machine
> prior to setting things up on Dreamhost but it seems like I'm missing
> instructions on how to
On Fri, Oct 31, 2008 at 1:42 PM, csingley <[EMAIL PROTECTED]> wrote:
> report_storage = ReportStorage(location='%s/reports' %
> settings.MEDIA_ROOT,
>base_url=settings.MEDIA_URL
> +'reports')
My guess is that you need a trailing slash here. Without it, the
On Nov 1, 4:54 am, Håkan Waara <[EMAIL PROTECTED]> wrote:
> 31 okt 2008 kl. 16.43 skrev ilyail3:
>
>
>
>
>
> > hello people, Is there a way to host several django projects under a
> > single virtual host?
> > I know this is possible with mod_php with wildcards as server alias
>
> > and later
On Nov 1, 8:22 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using chunked transfer encoding and i send a post http request to
> my Django application. But when I try to read the post body, it's not
> there (request.POST.keys() returns []). according to Wireshark, I send
>
On Nov 1, 10:06 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On Nov 1, 8:44 am, "Naitik Shah" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Fri, Oct 31, 2008 at 1:01 PM, Naitik Shah <[EMAIL PROTECTED]> wrote:
> > > On Thu, Oct 30, 2008 at 10:58 PM, Graham Dumpleton <
> > > [EMAIL PROTECTED]>
On Nov 1, 8:44 am, "Naitik Shah" <[EMAIL PROTECTED]> wrote:
> On Fri, Oct 31, 2008 at 1:01 PM, Naitik Shah <[EMAIL PROTECTED]> wrote:
> > On Thu, Oct 30, 2008 at 10:58 PM, Graham Dumpleton <
> > [EMAIL PROTECTED]> wrote:
>
> >> In respect of having nginx in front, one of the over benefits of
[EMAIL PROTECTED] wrote:
> Hello,
> I'm trying to receive a possibly large XML message via HttpRequest
> (POST method) with chunked encoding. However, when I send a response,
> I found out (using Wireshark) that the response is being sent before
> the whole POST request body is available. I
On Fri, Oct 31, 2008 at 6:29 AM, varikin <[EMAIL PROTECTED]> wrote:
>
> Check out django_extensions app,
> http://code.google.com/p/django-command-extensions/.
> It has a command, dumpscript, which creates a python script to
> populate the database. That might get ride of the incompatible types.
Hello,
I'm trying to receive a possibly large XML message via HttpRequest
(POST method) with chunked encoding. However, when I send a response,
I found out (using Wireshark) that the response is being sent before
the whole POST request body is available. I expected Django to be
buffering the
I'm having a little trouble tracking a down a small problem. My models
(which are working) look like this (with some of the boilerplate cut
out):
class Image(models.Model):
id = models.AutoField(primary_key=True)
pub_date = models.DateTimeField(blank=True)
caption =
Hi,
I'm using chunked transfer encoding and i send a post http request to
my Django application. But when I try to read the post body, it's not
there (request.POST.keys() returns []). according to Wireshark, I send
the response and right after that comes the request body.
Do you know how to wait
Hi, I've got a model defined like so:
"""
from django.conf import settings
from django.db import models
from django.core.files.storage import FileSystemStorage
class ReportStorage(FileSystemStorage):
@staticmethod
def filepath(instance, filename):
subdir =
On Fri, Oct 31, 2008 at 1:01 PM, Naitik Shah <[EMAIL PROTECTED]> wrote:
> On Thu, Oct 30, 2008 at 10:58 PM, Graham Dumpleton <
> [EMAIL PROTECTED]> wrote:
>
>>
>> In respect of having nginx in front, one of the over benefits of that
>> was that nginx could have been quite selective about the URLs
Hello,
I'm new to Django and it's taken me a while to get things setup
correctly on Dreamhost. I've done the tutorials on my local machine
prior to setting things up on Dreamhost but it seems like I'm missing
instructions on how to actually use Django. Yes, I've read the "Using
Django" section
On Thu, Oct 30, 2008 at 10:58 PM, Graham Dumpleton <
[EMAIL PROTECTED]> wrote:
>
> If there are definite idle periods of reasonable size, perhaps look at
> 'inactivity-timeout' option to WSGIDaemonProcess. This way daemon
> process will be restarted when doing nothing, and providing that
>
I run prefork with mod_wsgi (embedded) and mod_php. No troubles so
far, though I'm using MySQL with PHP and Postgres with Django, so I'm
not likely to experience the MySQL library issues Graham described.
I've read that mod_php actually doesn't like worker MPM, because come
common PHP
31 okt 2008 kl. 16.43 skrev ilyail3:
>
> hello people, Is there a way to host several django projects under a
> single virtual host?
> I know this is possible with mod_php with wildcards as server alias
>
> and later map urls to dirs using mod_rewrite
>
>
>DocumentRoot /var/www
>
Exactly. Thanks for the reference.
--
oMat
On Oct 31, 6:54 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Fri, Oct 31, 2008 at 12:39 PM, omat <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > Is it possible to update a chosen subset of attributes of a model
> > instance?
>
>
On Oct 31, 2:21 pm, varikin <[EMAIL PROTECTED]> wrote:
> On Oct 30, 5:12 am, "[EMAIL PROTECTED]"
>
>
>
> <[EMAIL PROTECTED]> wrote:
> > Hi everyone I am newbie to django and I am italian so excuse me for my
> > english :P
> > I have to execute a java program very simple look something like
Of course there is :), for the VirtualHost *, means everything, instead
use names like projecta, projectb, etc...if that doesn't make sense then
the best thing to do prior to messing with your settings is to read the
documentation from apache on VirtualHost.
--neuro
On Fri, Oct 31, 2008 at
On Fri, Oct 31, 2008 at 12:39 PM, omat <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> Is it possible to update a chosen subset of attributes of a model
> instance?
>
http://code.djangoproject.com/ticket/4102
asks for this, I believe.
Karen
--~--~-~--~~~---~--~~
You
Hi all,
Is it possible to update a chosen subset of attributes of a model
instance?
In my case, the view function saves a model instance which was updated
in the model's custom save() method. Thus, the update by the save() is
overridden.
Pseudo code of the scenario:
class MyModel(Model):
On Fri, Oct 31, 2008 at 11:55 AM, Frank Peterson
<[EMAIL PROTECTED]>wrote:
>
> I am using the following
> {{ section.get_absolute_url|cut:"/news/" }}
> on a string that is
> /news/new-york-jets/news/
>
> I need to remove the first /news but the CUT filter removes all
> instances of it, is there a
I am using the following
{{ section.get_absolute_url|cut:"/news/" }}
on a string that is
/news/new-york-jets/news/
I need to remove the first /news but the CUT filter removes all
instances of it, is there a way for me to remove on the first "/news"?
hello people, Is there a way to host several django projects under a
single virtual host?
I know this is possible with mod_php with wildcards as server alias
and later map urls to dirs using mod_rewrite
DocumentRoot /var/www
ServerName www.projects
ServerAlias *.projects
On Fri, Oct 31, 2008 at 10:24 AM, Fabio Natali
<[EMAIL PROTECTED]>wrote:
>
> Rajesh Dhawan wrote:
> [...]
> > > What's more, how can I make those callables columns sortable
> > > within the change list page? I'm working with trunk. I read this:
> > > http://code.djangoproject.com/changeset/9211
Karen Tracey wrote:
[...]
> > Ok, we can't sort on callable columns. Anyway that's a pity...
> The sorting is done at the database level (SQL ORDER BY), as is the
> pagination (SQL OFFSET & LIMIT), so it is efficient (DBs are optimized to do
> these things efficiently).
Karen thank you very
Rajesh Dhawan wrote:
[...]
> > What's more, how can I make those callables columns sortable
> > within the change list page? I'm working with trunk. I read this:
> > http://code.djangoproject.com/changeset/9211 Does this mean that I
> > can add some callable and then alphabetically order them?
>
That's exactly what I'm looking for.
I'll probably try adding that feature to the model base class or as a
mixin.
@classmethod
def get_field_option_by_name(self, fieldname, optionname):
field = self._meta.get_field_by_name(fieldname)[0]
return getattr(fieldname, optionname)
possibly
Hello,
I'm checking out the i18N features and apparently the browser setting takes
over always, if I try to select the language via the link it doesn't work,
it just falls back to whatever language is set in the browser (i.e. u click
and nothing happens, no error messages, nothing).
If I change
On Oct 30, 1:57 pm, "Naitik Shah" <[EMAIL PROTECTED]> wrote:
> I ran into issues with this approach as well - first uniqueness constraints
> were failing, which I managed to fix manually. Next I got ContentType
> matching query issues, which I have not fixed yet.
>
> I was hoping to come up
>
> > > So if these built in filters are marking my strings safe, inspite of
> > > unsafe data being passed in, should they not handle escaping as well?
>
> > The problem seems to be that your filter function doesn't mark itself
> > with an is_safe attribute (defaulting it to False). So try
On Oct 30, 5:12 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hi everyone I am newbie to django and I am italian so excuse me for my
> english :P
> I have to execute a java program very simple look something like this:
>
> public class Book {
> public static void main(String[] args)
On Oct 30, 6:58 am, Rajesh Dhawan <[EMAIL PROTECTED]> wrote:
> On Oct 30, 1:30 am, shabda <[EMAIL PROTECTED]> wrote:
>
> > So if these built in filters are marking my strings safe, inspite of
> > unsafe data being passed in, should they not handle escaping as well?
>
> The problem seems to be
Hi
I'm working on a registration form which is based, among the others,
on this model:
class City(models.Model):
prov_name =
models.CharField(verbose_name='Provincia',max_length=50)
(obviously i'm writing down just the field i'm interested in to save
some space..)
In the form i have to put
On Oct 31, 1:32 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On Oct 31, 11:01 am, Daniel Roseman <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Oct 31, 9:51 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]>
> > wrote:
>
> > > Hi,
>
> > > I've this model:
>
> > > from django.contrib.auth.models
On Oct 31, 11:01 am, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Oct 31, 9:51 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hi,
>
> > I've this model:
>
> > from django.contrib.auth.models import User
>
> > class Player(models.Model):
> > first_name =
Try replacing
workbook.save('output.xls')
return response
with
workbook.save('output.xls')
response.write(open('output.xls', 'b').read())
return response
regards
Steve
laspal wrote:
> So how can I fix it.
> I am not able to fix it.
> Thanks
>
> On Oct 30, 4:26 pm, Steve
So how can I fix it.
I am not able to fix it.
Thanks
On Oct 30, 4:26 pm, Steve Holden <[EMAIL PROTECTED]> wrote:
> laspalwrote:
> > Any one can help me out.
> > Thanks.
>
> > On Oct 29, 11:41 am,laspal<[EMAIL PROTECTED]> wrote:
> >> Hi,
> >> I am trying to create Excel file usingpyExceleratorbut
I'm trying to accomplish the same thing: use django standalone.
After getting DJANGO_SETTINGS_MODULE set correctly so that it finds my
settings.py, I get:
File "C:\Python25\Lib\site-packages\django\db\models\base.py", line
51, in __new__
kwargs = {"app_label":
On Oct 31, 9:51 am, "Alfredo Alessandrini" <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I've this model:
>
> from django.contrib.auth.models import User
>
> class Player(models.Model):
> first_name = models.CharField(max_length=30)
> last_name = models.CharField(max_length=40)
> email =
Hi,
I've this model:
from django.contrib.auth.models import User
class Player(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=40)
email = models.EmailField()
user = models.ForeignKey(User, blank=True, null=True)
I try to set
On Oct 30, 10:13 pm, Alex G <[EMAIL PROTECTED]> wrote:
> Thanks for the reply, DR.
>
> How would I use the generic relationship without the backward link?
>
> I have the normal auth.user class, and I have the my.user class that
> extends it and has a polymorphic link pointing at auth.user. The
>
31 okt 2008 kl. 04.23 skrev Graham Dumpleton:
>
>
>
> On Oct 31, 10:14 am, Håkan Waara <[EMAIL PROTECTED]> wrote:
>> Hi folks,
>>
>> I'm in the process of for the first time deploying a django site that
>> (unfortunately) needs to share its Apache with an existing PHP site.
>>
>> I've been
Hi Merrick,
> How can I access request.user in a clean method of a ModelForm?
>
> class UserEmailForm(ModelForm):
> ...
>
You can instantiate your form passing the request or the user as
argument:
class UserEmailForm(ModelForm):
def __init__(self, *args, **kw):
self.request =
On 29 Okt., 14:00, Thomas Guettler <[EMAIL PROTECTED]> wrote:
> > Thanks to all who answered, now I'll go looking for the person who
> > messed with the development machine.
>
> Everybody can make mistakes. The root of the problem is (or was)
> that you don't see tracebacks if
How can I access request.user in a clean method of a ModelForm?
I have the following code in forms.py:
===
#profle email form
class UserEmailForm(ModelForm):
class Meta:
model = User
fields = ['email',]
def clean_email(self):
email_submitted =
I have the code below:
===
class UserEmailForm(ModelForm):
class Meta:
model = User
fields = ['email',]
def clean_email(self):
email_submitted = self.cleaned_data.get('email')
email_exists =
On Fri, Oct 31, 2008 at 4:08 PM, Tonne <[EMAIL PROTECTED]> wrote:
>
> So, what I've done is use Model.objects.values() to limit the returned
> values, which is not ideal as I'm losing the objectness of the
> queryset.
>
> I've worked around the loss Queryset.get_absolute_url by using a less
>
On Fri, Oct 31, 2008 at 5:08 AM, Tonne <[EMAIL PROTECTED]> wrote:
>
> So, what I've done is use Model.objects.values() to limit the returned
> values, which is not ideal as I'm losing the objectness of the
> queryset.
>
> I've worked around the loss Queryset.get_absolute_url by using a less
>
Thanks Marcelo.
--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
On Fri, Oct 31, 2008 at 4:06 AM, please smile <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I have uploaded some images in a folder and also saved the image name
> into data base table.
> Now I need to fetch and display all the images to my client side web page .
> How can I do this .Please help.
So, what I've done is use Model.objects.values() to limit the returned
values, which is not ideal as I'm losing the objectness of the
queryset.
I've worked around the loss Queryset.get_absolute_url by using a less
than elegant semi-hardcoded url.
So if I'm missing a blindingly obvious way of
On Fri, Oct 31, 2008 at 4:37 AM, Tonne <[EMAIL PROTECTED]> wrote:
>
> I have spent hours looking in the docs and one this list for an answer
> to this problem:
>
> I have a model that has, for example, 20 fields.
>
> On my site's homepage, where I'd like to offer a preview version of
> the
I have spent hours looking in the docs and one this list for an answer
to this problem:
I have a model that has, for example, 20 fields.
On my site's homepage, where I'd like to offer a preview version of
the object, I'd need to retrieve only say, half of those fields to be
displayed.
My
sadeesh Arumugam wrote:
> Hi Friends,
>
> I want to create a login form in client side, anybody please send me
> the Sample login page for the client side coding..
>
Are you reading the answers to your questions before sending them out again?
regards
Steve
Hi Friends,
I want to create a login form in client side, anybody please send me the
Sample login page for the client side coding..
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to
On Oct 31, 4:09 pm, "Naitik Shah" <[EMAIL PROTECTED]> wrote:
> > Also indicate how much traffic each site gets and whether any would
> > potentially be idle for periods, as can then look at inactivity
> > timeouts etc.
>
> As embarrassing as it sounds, I don't have good numbers available yet.
Hi All,
I have uploaded some images in a folder and also saved the image name
into data base table.
Now I need to fetch and display all the images to my client side web page .
How can I do this .Please help.
Thanks
--~--~-~--~~~---~--~~
You received this
70 matches
Mail list logo