I have the following view set up:
def concord(request):
searchterm = request.GET['q']
... more stuff ...
return render_to_response('concord.html', locals())
With URL "http://mysite.com/concord/?q=برشه";, and template code
Your search for {{ searchterm }} returned {{ results }}
re
Yes, that worked. Thank you!
Of course, now that I fixed that, I have to deal with the other
problem that I was avoiding... But I'll post that in a different
question. :-)
Thanks again, Pedro.
On Apr 15, 9:35 pm, Pedro Kroger wrote:
> You can try something like:
>
> def my_view(request):
>
On Fri, Apr 15, 2011 at 2:44 PM, Markus T. wrote:
>
> I have a strange effect using pagination.
>
> I have a model with events that have a date, time, title, description
> field and so on. I display the events using pagination. In the model's
> Meta class I tell Django to order by date.
>
> I crea
I'm using the admin functionality for most of my needs (a nice CRUD DB
frontend, not a user-facing website). Is there a best way to get one of my
inline models presented at the top of the form instead of the bottom? I
would greatly prefer not to have to specify all of the fields (via
ModelAdm
On Fri, Apr 15, 2011 at 8:54 PM, Pedro Kroger wrote:
> result = self.client.post('/dashboard/')
>
> But I don't know how to test if the result is the dashboard or the
> login page. Could you guys point me in the right direction?
from the docs
(http://docs.djangoproject.com/en/1.3/topics/testing/
Hi,
I writing some unit tests and I'd like to test if an unlogged user has
access to the main dashboard page.
In my application, if the user is logged it will go to the dashboard,
if it isn't, it will go to the login page.
I know how to get to the webpage:
result = self.client.post('/dashboard/')
You can try something like:
def my_view(request):
...
context = []
for offset in offsets:
before = ' '.join(tokens[offset-5:offset])
word = tokens[offset]
after = ' '.join(tokens[offset+1:offset+5])
context.append(before, word, after)
... ..
I'm fairly new to django and now I'm stuck on this error...
'Context' object has no attribute 'render_context'
searching around has told me that render_context did not exist pre
django 1.2 but I have django 1.2.4 installed. Here is some of my stack
trace...
AttributeError at /hsws/
'Context' obj
I'm trying to make a concordance (ie, a list of a certain searchterm,
including its surrounding context) and I can get it to work in the
interpreter, but I'm having problems figuring out how to make it a
list that I can pass it to the template. This is what works in the
interpreter (tokens is a li
On Friday, April 15, 2011 4:21:56 PM UTC-4, Brian Neal wrote:
>
> You didn't post how you loaded the template in your view function. In
> particular, what path string you used.
>
Ah. The missing piece to bring order to all of this confusion on my
part.
I was using "myapp/index.html", per
On Apr 15, 2:23 pm, Jeff Blaine wrote:
> Thank you all. I will digest the replies when I have the time to properly
> focus back on the issue (it's obviously small, since I have a workaround in
> place by shoving base.html into the project root).
>
> It still, regardless of solutions, even in ligh
Thank you all. I will digest the replies when I have the time to properly
focus back on the issue (it's obviously small, since I have a workaround in
place by shoving base.html into the project root).
It still, regardless of solutions, even in light of the words shared in this
thread (which I'
Thank you to everyone answering - I will look into the Firebug
approach the next time. But now I am 99.9% certain that
> In an item is not in the original choices then it's invalid.
This is the problem. In the cases where things failed the choice
eventually sent from the client was not in the ini
Can you show us the field declaration in your form -- specifically the
value of 'choices'?
In an item is not in the original choices then it's invalid.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-
I suggest you to use firefox + firebug extension to see what exactly
your form is sending to server in POST (or GET) request via firebug's
"Console" tab. If data in request is correct every time (change both
selectors, change oly one of them, without changes) -- then problem
somewhere in your djang
I suggest you to use firefox + firebug extension to see what exactly your
form is sending to server in POST (or GET) request via firebug's "Console"
tab. If data in request is correct every time (change both selectors, change
oly one of them, without changes) -- then problem somewhere in your djang
Hi there. I'm trying to install Django on my computer, but I'm having
problems. Any help would be really, really appreciated.
My first attempt was with the BitNami Django Stack. It seemed to have
installed, but I couldn't verify it through 'import django' on Idle. I
played with it a few times, and
Thank you for answering:
On Apr 15, 8:47 pm, Shawn Milochik wrote:
> Two things:
>
> 1. Does your form use a prefix?
I don't really what you mean with prefix?
>
> 2. Please post a relevant excerpt of your request.POST data.
(I mangled things a bit up in the original message; in particu
Two things:
1. Does your form use a prefix?
2. Please post a relevant excerpt of your request.POST data.
--
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
Hi everybody,
I have a strange effect using pagination.
I have a model with events that have a date, time, title, description
field and so on. I display the events using pagination. In the model's
Meta class I tell Django to order by date.
I create a queryset like this:
events = Event.objects.f
Thank you for the response. Is there any documentation / books out
there that you would recommend reading to get acquainted with django
in that perspective?
On Apr 15, 10:58 am, Jirka Vejrazka wrote:
> I use Djano ORM for a lot of my backend processing where no web is
> involved. Just make sure t
Hello;
I have a problem with a Django using JavaScript which I really don't
understand. It must be said that this is my first time using
JavaScript to beef up my forms - that might be source of the problem.
The form presents the user with two drop down selectors and a submit
button like:
Co
My solution is:
def save( self ):
if self.image1:
original = Image.open( self.image1 )
if original.mode not in ('L', 'RGB'):
original = original.convert('RGB')
cp_image = original.copy()
cp_image_handle = StringIO()
cp_image.save( cp_image_handle, 'JPEG'
Hi,
I want to change the filetype of any uploaded image to JPG. What is
the most efficient way for this? I think i surely do this before
save(). Any ideas?
Thanks,
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
On Thu, Apr 14, 2011 at 4:50 PM, Yuka Poppe wrote:
> Hi Jeff,
>
> I think Gladys is correct, the reason for your code finding the index
> template, is because its probably looking for 'myapp/index.html'
> instead of just 'index.html'
>
> Im not really sure if you're also distinguishing between th
Hi,
I have a model which defines a blogger property, which is a OneToOne field
on the django.contrib.auth.models.User model as follows:
class BlogUser(models.Model):
blogger = models.OneToOneField('auth.User', related_name='blogger')
url = models.SlugField(max_length=125, unique=True, hel
I use Djano ORM for a lot of my backend processing where no web is
involved. Just make sure that DJANGO_SETTINGS_MODULE is defined in
your environment and you can use pretty much any part of Django in
your own code/scrits/whatever.
HTH
Jirka
On 15/04/2011, Aviv Giladi wrote:
> Hey guys,
Hey guys,
I am an experienced Python developer starting to work on web service
backend system. The system feeds data (constantly) from the web to a
MySQL database. This data is later displayed by a frontend side (there
is no connection between the frontend and the backend). The backend
system cons
Ok its solved now, I updated my nested regroup with the following
{% regroup dict by col_mapper as column_gr %}
{% for column in column_gr %}
{{ column.grouper }}
{% with column.list as groupr %}
{% regroup groupr by main_tit
This week I installed the latest windows 7 microsoft updates.
Also since a few days, IE9 hangs when I try to connect to http://127.0.0.1:8000
I do not see any movement on the Django development server DOS-screen.
Firefox4 is OK, and connecting to Opera11 at the same time: no
problem.
But IE9 hangs
On Fri, Apr 15, 2011 at 9:25 AM, Jirka Vejrazka
wrote:
> I use exactly the same setup. Look up the "django-odbc" package.
> This will be quite easy to use and setup, but there are some
> unresolved bugs in that package related to multi-db support. Most of
> them have patches attached to their tic
Mike,
I use exactly the same setup. Look up the "django-odbc" package.
This will be quite easy to use and setup, but there are some
unresolved bugs in that package related to multi-db support. Most of
them have patches attached to their tickets.
Cheers
Jirka
On 15/04/2011, Mike Kenny
Hi,
I am trying to use a django application developed on Linux with MySQL
on a Windows box with SQL Server. I have downloaded pyodbc and set my
ENGINE to sql_server.pyodbc (and tried just pyodbc as I was able to
import this into python but not sql_server). Both result in an error
message listing t
First off, you'll probably get better responses on the Satchmo list.
Secondly, changing languages doesn't change currency symbols, which should
make sense. 1 Euro is not equal to 1 Dollar. If we were to change symbols,
we'd also need to do a currency conversion. It's not impossible by any means
ju
Thanks a lot for that suggestion.
On Apr 15, 2011 8:52 AM, "Daniel Hilton" wrote:
> On 15 April 2011 13:01, roberto wrote:
>> You can also have a look at askbot.
>> It seems to have more functionalities.
>> Good luck !
>>
>> www.askbot.org
>>
>> On Apr 14, 6:43 pm, AJ wrote:
>>> Why has this be
Yes indeed!
Thank you very much for your help.
Rob
--
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+unsubscr...@goog
This should do the trick:
class PrijsvraagForm(ModelForm):
mail = forms.EmailField(error_messages={'required':'Vul aub een geldig
Email adres in', 'invalid': 'Het email adres is niet geldig'})
class Meta:
model = Prijsvraag
def clean_code(self):
super(PrijsvraagForm,
Hi,
I've been working on a project that takes into consideration performance as
the top priority therefore am trying to use single to queries at each page
to collect all the needed information.
Any who, I got to a point where I have one query set that need to be
regrouped based on column (left, r
@Martin
Thank you for your reply.
I tried to do this, but I still get the default error message (the
custom error from the code field works as it should):
from django.db import models
from django.forms import ModelForm
from django import forms
class Prijsvraag(models.Model):
naam = mode
Error messages in ModelForms work perfectly fine.
class PersonForm(forms.ModelForm):
first_name = forms.CharField(error_messages={'required': 'Please enter
your first name!'})
class Meta:
model = Person
http://docs.djangoproject.com/en/dev/ref/forms/fields/#error-messages
--
Y
On 15 April 2011 13:01, roberto wrote:
> You can also have a look at askbot.
> It seems to have more functionalities.
> Good luck !
>
> www.askbot.org
>
> On Apr 14, 6:43 pm, AJ wrote:
>> Why has this become a case for me? I just wanted to know about a particular
>> solution, that whether it exis
You can also have a look at askbot.
It seems to have more functionalities.
Good luck !
www.askbot.org
On Apr 14, 6:43 pm, AJ wrote:
> Why has this become a case for me? I just wanted to know about a particular
> solution, that whether it exists or not. I did try Google and other forums.
>
> I ne
I want to show a custom error message in a Modelform. With a normal
form I can add an error message like this:
error_messages={'required': 'Vul aub een geldig Email adres in',
'invalid': 'Het email adres is niet geldig'}
With a ModelForm this won't work. Is there a way to add a custom error
messa
Hi everyone,
I have a class definition as follows in my models:
class BlogUser(models.Model):
*blogger = models.OneToOneField(User)* *# User
being the django.contrib.auth.models user*
featured =models.BooleanField()
url =
Solved!
in settings.py file, option 'ENGINE' must be like this: django.db.backends.mysql
2011/4/14, pagan :
> same problem. apache2, mod_wsgi, python-mysqldb installed. When i add
> databases engine, name, user, password in settings.py, i got a
> message:
>
> ImportError at /wsgi
> No module named
glad it did work :)
On Apr 15, 10:32 am, λq wrote:
> Wow, this is exactly what I am looking for. Thanks a million! :D
>
> 2011/4/15 Mengu
>
>
>
>
>
>
>
> > Hi,
>
> > I've just asked in the #django channel. Read this
>
> >http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contri...
>
Hello all,
i updeted my app to django 1.3 and stop to work my custom admin.
use_fieldsets = [
(None, {'fields': ('photo1', 'title',)}),
]
i have this error
Unknown field(s) (title) specified for HomePage
when i dont use use_fieldsets the admin work but i need to custom
the order of
Wow, this is exactly what I am looking for. Thanks a million! :D
2011/4/15 Mengu
> Hi,
>
> I've just asked in the #django channel. Read this
>
> http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.queryset
> .
>
> On Apr 15, 6:27 am, λq wrote:
> > Thanks Meng
Hi,
I've just asked in the #django channel. Read this
http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.ModelAdmin.queryset.
On Apr 15, 6:27 am, λq wrote:
> Thanks Mengu,
>
> I have another question:
>
> how to set admin's default view NOT to display items if is_delete
49 matches
Mail list logo