Is there any way to take out the first letter of a string in django
template system?
ex:
x("Hai") should give o/p as: "H"
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this gro
{{var|slice:"0"}}
On 12/13/08, Vicky wrote:
>
> Is there any way to take out the first letter of a string in django
> template system?
> ex:
>
> x("Hai") should give o/p as: "H"
> >
>
--
---
Александр Кошелев
daeva...@gmail.com
--~--~-~--~~~---~--~~
You re
Hi.
I want to let my users can change their mugshot without updating their
whole profile. When i have a form with only mugshot field, form never
pass validaiton. If i add another field to that form it can pass
validation now. My model and forms are below.
class Profile(models.Model):
""
Hi,everyone.
The database-abstraction API in django can query the database by
using table.objects.filter('x =1') or table.objects.get('x = 1').
However, these build method will return all the columns in the table
which are satisfied x = 1, like select * from table where x = 1.
If I wan
On Sat, Dec 13, 2008 at 5:55 AM, Lee wrote:
>If I want to return a specified column in this situation without
> using SQL query (select y from table where x =1), how to do it?
There is a method which will do this, and it is listed in the database
API documentation alongside all the other que
Hi, James Bennett
Thanks for you reply.
Howerver, I have already read the database API documentation, and I
can't find this method.
On Dec 13, 11:13 pm, "James Bennett" wrote:
> On Sat, Dec 13, 2008 at 5:55 AM, Lee wrote:
> > If I want to return a specified column in this situation w
http://docs.djangoproject.com/en/dev/ref/models/querysets/
Check for values for exmple. Has a fields property that will allow you
to specify the fields you want to return.
2008/12/13 Lee :
>
> Hi, James Bennett
>
> Thanks for you reply.
>
> Howerver, I have already read the database API documen
Hi, Antoni Aloy
Thanks a lot. I got it.
cheers
Lee
On Dec 13, 11:46 pm, "Antoni Aloy" wrote:
> http://docs.djangoproject.com/en/dev/ref/models/querysets/
>
> Check for values for exmple. Has a fields property that will allow you
> to specify the fields you want to return.
>
> 2008/12/13 Lee :
How to change style on an element?
http://interviewdoor.com/questions-faqs/viewtopic.php?f=155&t=1163
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-
using django-1.0.2 with apache-1.3 (OpenBSD), python-2.4, fastcgi and
py-flup-1.0 from yesterday's mercurial tip throws these logs into
error-log and 500 to any requests:
apache error logs:
Traceback (most recent call last):
File "../lib/flup/server/fcgi_base.py", line 558, in run
File "../
This might be overkill, but you could use middleware and parse for the
version number in request.path:
from django.conf import settings
from django.http import HttpResponseRedirect
from mysite import settings as local_settings
class DetectSiteVersion(object):
def __init__(self):
sel
On Nov 28, 3:48 pm, mondonauta wrote:
> well what i got is this error:
> __
> Exception Type: ImproperlyConfigured
> Exception Value: 'ProfessorAdmin.fieldsets[4][1]['fields']'
> refers to field 'phone_number'
That type of system is usually called a "Tumblelog" - and you can find
a lot of info in these two articles below. Ryan's uses generic foreign
keys and an "intermediary" object, so to speak, so that you just query
that one object and it knows about all instances of your
app1/app2/app3 models. This
On Dec 7, 8:45 pm, Malcolm Tredinnick
wrote:
> On Sun, 2008-12-07 at 14:24 -0300, Patricio Palma wrote:
>
> > On Sun, Dec 7, 2008 at 2:12 AM, Karen Tracey
> > wrote:
>
> > Something like View->Page Source from the browser menu?
> > (That's what Firefox calls it -- I'd guess mos
Hi Graham,
Thanks for your response. I've taken a quick look over the WSGI spec
and it looks good. I have a couple questions though and I apologize
if they've already been answered in the forum or in the Django
documentation
1) Based on your suggestion to use WSGI, I'm assuming Django a
I have the exact same problem with Django 1.0.2 Final on Debian Etch
(Apache 2.2.3-4+etch6 / mod_python 3.2.10-4) -- My settings.py, vhost
and urls.py are nearly exactly the same as above (the relelant parts
anyway.)
On Dec 12, 3:00 am, Bluemilkshake
wrote:
> Of course.
> urls.py below:
>
> Unde
On Dec 13, 6:43 pm, benw wrote:
> I have the exact same problem with Django 1.0.2 Final on Debian Etch
> (Apache 2.2.3-4+etch6 / mod_python 3.2.10-4) -- My settings.py, vhost
> and urls.py are nearly exactly the same as above (the relelant parts
> anyway.)
>
> On Dec 12, 3:00 am, Bluemilkshake
>
Hi all, just to confirm a suspicion I have with using the
'create_object' generic view:
#urls.py
...
(r'^accepts/photos/$',
'django.views.generic.create_update.create_object',
{'model':photologue.models.Photo}),
...
renders the form A-OK. However, choosing an image for the file upload
field
Hello,
I have a model that I want to have an optional generic relation to any
other kind of model.
content_type = models.ForeignKey(ContentType, null=True, blank=True)
object_id = models.PositiveIntegerField(null=True, blank=True)
content_object = generic.GenericForeignKey(null=True, blank=Tr
GenericForeignKey is pseudo-field. It doesn't have any own underlying db
field representation, so there is no need to specify it as blank and
nullable.
On Sat, Dec 13, 2008 at 22:45, mwebs wrote:
>
> Hello,
>
> I have a model that I want to have an optional generic relation to any
> other kind
On 13 déc, 14:41, barbara shaurette wrote:
> This might be overkill, but you could use middleware and parse for the
> version number in request.path:
>
> from django.conf import settings
> from django.http import HttpResponseRedirect
>
> from mysite import settings as local_settings
>
> class Det
Hi djangonauts,
I am new to django and i developed the site using django.
My site works well in my system local server ..
I hosted my site in dreamhost server and the url is www.csmit.org
But now in the site the images fail to load as well as the media..
But i can access from the path www.
Glad to help.
That's strange that you had to add that JS to your template--it should
be included automatically. Looking at the admin default options:
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/options.py#L202
it should be on every object add/edit page.
Maybe you def
I have only overriden the title and content blocks, nothing more, so
it really looks strange
On Dec 13, 10:04 pm, Jeff FW wrote:
> Glad to help.
>
> That's strange that you had to add that JS to your template--it should
> be included automatically. Looking at the admin default
> options:http:/
Hello djangonauts,
I am attempting to use Django and Flex.
It went all good until i moved to mod_python on my local machine
(127.0.0.1).
If i try to upload from the flex component (swf comming from
127.0.0.1) to a django view (also on localhost) i get a security
violation error 2048 from flex !
On Dec 13, 7:37 pm, Sura wrote:
> Hi djangonauts,
> I am new to django and i developed the site using django.
> My site works well in my system local server ..
> I hosted my site in dreamhost server and the url iswww.csmit.org
> But now in the site the images fail to load as well as the m
Hi,
I want to extend default template for /admin/photosite/photo/some_id/.
Basically, I want to display, only when editing, a thumbnail of the
photo with JCrop widget for cropping. How can I access the 'image'
field of the edited record? I think I need not to write a custom view
here, since I onl
I have two models, Trade and Fill. A Trade can have many fills. Fill
has a FK to Trade:
class Trade(models.Model):
trade_date = models.DateField(auto_now_add=True, editable=False)
side = models.CharField(max_length=12, choices=SIDE_CHOICES)
inst = models.ForeignKey(Inst)
class Fill(m
On Dec 13, 9:30 pm, DavidA wrote:
> I have two models, Trade and Fill. A Trade can have many fills. Fill
> has a FK to Trade:
>
> class Trade(models.Model):
> trade_date = models.DateField(auto_now_add=True, editable=False)
> side = models.CharField(max_length=12, choices=SIDE_CHOICES)
>
I have a database of 5 million locations in the U.S. I would like to
support _fast_ distance / proximity searches. In other words the user
enters an address, my app geocodes the location and then returns
nearby points of interest. The user can specify the proximity which
might be something like
i've made a modification in a App i created. run syncdb, it dont show
changes made. what could be wrong? thanks in advance
from this:
class CarMake(models.Model):
name = models.CharField(max_length=30)
class CarModel(models.Model):
name = models.CharField(max_length=30)
to this:
clas
The problem is that trade is required so is_valid will fail.
On Dec 13, 5:01 pm, Daniel Roseman
wrote:
> On Dec 13, 9:30 pm, DavidA wrote:
>
>
>
> > I have two models, Trade and Fill. A Trade can have many fills. Fill
> > has a FK to Trade:
>
> > class Trade(models.Model):
> > trade_date =
On Sat, Dec 13, 2008 at 11:08 PM, volk23 wrote:
>
> i've made a modification in a App i created. run syncdb, it dont show
> changes made. what could be wrong? thanks in advance
>
You must delete related table manually. Then manage.py syncdb.
--
Hüseyin Berberoğlu
http://www.birazkisisel.com -
On 12.12-08:28, Ana wrote:
[ ... ]
> Thank you both for the suggestions. There is a problem with the
> sequence number in the primary keys. When I created a new table
> without data the insert worked fine.I will try to recreate the
> sequences and hope I don't have to re-enter the data.
you
I meant to direct this question to geodjango experts. Thanks.
--~--~-~--~~~---~--~~
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
On Dec 13, 10:12 pm, DavidA wrote:
> The problem is that trade is required so is_valid will fail.
>
So exclude it from the form:
class AddFillForm(forms.ModelForm):
class Meta:
exclude = ('trade',)
--
DR.
--~--~-~--~~~---~--~~
You received this messa
Hello, I'm writing a script and I'd like to login into a django webapp
using pycurl or urllib.
I've problems with the cookies, and every time the message is: "The
session has expired"
Does anybody know how can I make it?
Thank you!
--~--~-~--~~~---~--~~
You receiv
On Dec 13, 9:08 pm, volk23 wrote:
> i've made a modification in a App i created. run syncdb, it dont show
> changes made. what could be wrong? thanks in advance
>
What's wrong is that you didn't read the documentation:
http://docs.djangoproject.com/en/dev/ref/django-admin/#syncdb - see
the big b
Hi all!
I am really new to both python and Django, but so far I really like
it.
My first project is a blog that I am creating while going through the
beginner tutorial for a poll.
I am simply reading the information for the poll and then using it for
my blog, but I have a bit of a problem.
Catego
Jim wrote:
> Hi Graham,
>
> Thanks for your response. I've taken a quick look over the WSGI spec
> and it looks good. I have a couple questions though and I apologize
> if they've already been answered in the forum or in the Django
> documentation
>
> 1) Based on your suggestion to use
Hi,
It's possible call a query with max or min value?:
like this:
game_list = game.objects.filter(Q(max_rating > player.rating) &
Q(min_rating < player.rating))
Thanks in advance,
Alfredo
--~--~-~--~~~---~--~~
You received this message because you are subscr
Ok, I found it, {{ original.image }}
:-)
--~--~-~--~~~---~--~~
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 e
got it. thank you.
--~--~-~--~~~---~--~~
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
django-users+u
On Sat, 2008-12-13 at 02:14 -0800, Vicky wrote:
> Is there any way to take out the first letter of a string in django
> template system?
> ex:
>
> x("Hai") should give o/p as: "H"
The "slice" filter has already been suggested, but this is a case of the
template system providing more than o
On Sat, 2008-12-13 at 05:07 -0800, Vladimir Kirillov wrote:
> using django-1.0.2 with apache-1.3 (OpenBSD), python-2.4, fastcgi and
> py-flup-1.0 from yesterday's mercurial tip
By the way, for the future, you'll probably want to find a way to work
out what the real subversion revision is that yo
On Sat, 2008-12-13 at 14:44 -0800, Adrián Ribao wrote:
> Hello, I'm writing a script and I'd like to login into a django webapp
> using pycurl or urllib.
> I've problems with the cookies, and every time the message is: "The
> session has expired"
>
> Does anybody know how can I make it?
You for
On Sat, 2008-12-13 at 15:17 -0800, XeroXer wrote:
[...]
> The problem I am having is how do I show this in a nice list with the
> child object following their parent.
> Like:
>
> Parent
>
> Child
>
>
> Single
>
>
> Well something like that, maybe someone can help me ... :)
The unordered_l
On Sun, 2008-12-14 at 00:46 +0100, Alfredo Alessandrini wrote:
> Hi,
>
> It's possible call a query with max or min value?:
>
> like this:
>
> game_list = game.objects.filter(Q(max_rating > player.rating) &
> Q(min_rating < player.rating))
Not yet. Search the archives of this list for the wor
OK, I'm new - worked my way through the tutorial, been reading some of
the other docs. Really feel the best design principle should be to
keep all app related stuff in the app directory (and feel that one day
the tutorial docs could reflect this).
So was modifying tutorial to use the app_directo
I am developing an app with a customized admin/change_list.html [1]. I
added djang-batchadmin, which itself has a template extending admin/
change_list.html (batchadmin/templates/batchadmin/change_list.html)
What is the most effective pattern to manage multiple apps extending
the same admin templ
On Sat, 2008-12-13 at 18:13 -0800, ptone wrote:
[...]
> So was modifying tutorial to use the app_directories loader
>
> Had to take out the 'polls/' subdir part of the template path - that
> made sense.
No, you didn't have to do that. It's optional and, in this case, is the
cause of your later
On Sat, 2008-12-13 at 18:17 -0800, Jeff Kowalczyk wrote:
> I am developing an app with a customized admin/change_list.html [1]. I
> added djang-batchadmin, which itself has a template extending admin/
> change_list.html (batchadmin/templates/batchadmin/change_list.html)
>
> What is the most effe
Hi,
I am running Django 1.0 on Windows Server 2003, Python 2.5 with
mod_wsgi. I am having trouble capturing any exceptions in my code
either through Apache's error log or by having an email sent to me.
As a simple test I added
a = [1,2,3]
b = a[4]
to the top of one of my views, which does generat
Fixed it.
See the code here:
http://www.djangosnippets.org/snippets/1246/
--~--~-~--~~~---~--~~
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
If you want to edit them together in the admin then do this for your
admin class
#
class BookInline(admin.TabularInline)
model = Book
extra = 2
class AuthorOptions(admin.ModelAdmin)
inlines = [BookInline]
admin.register(Author, AuthorOptions)
#--
Thanks for the good info. Let me explain why I would want to develop
my own web server... I've got a real time, asynchronous server that
uses a proprietary binary protocol to monitor remote systems using a
push model, and I'd like to expose the incoming data over HTTP using a
web app, also using
56 matches
Mail list logo