+1, Perhaps building a fully-working site using all parts of Django,
implementing interesting and useful features. Also setting-up with reverse
proxy/static server with lean, fast networking. Depends on how long the
class is I suppose.
On Tue, Dec 9, 2008 at 3:32 PM, Jane <[EMAIL PROTECTED]>
There is no way to have per-instance limit_choices_to.
On Wed, Dec 10, 2008 at 03:56, GuyBowden <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I've looked about but can't find the answer to this.
>
> I'd like to set the limit_choices_to value of a ForeignKey field based
> on another selection in the
hey can u plse attach and sent me a sample project that uses forms if
possible. I need to knw wr anw hw to create forms, should we include
anything in settings.py or urls.py?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Do you have CommonMiddleware enabled in your settings.py?
http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.middleware.common
On Dec 9, 7:29 pm, Nuno Machado <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using flatpages to display some static content in a site. The
> "about" page is
Oh ok, thanks a lot!!
Yes, I'm learning python too at the same time as django...
On Dec 10, 4:35 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Tue, 2008-12-09 at 19:23 -0800, DragonSlayre wrote:
> > Hi,
>
> > I've just made a new 'Student' model, and was trying to create a new
> >
On Tue, 2008-12-09 at 19:23 -0800, DragonSlayre wrote:
> Hi,
>
> I've just made a new 'Student' model, and was trying to create a new
> Student in the admin interface, and I got the following error:
>
> Environment:
>
> Request Method: POST
> Request URL:
Hi,
I've just made a new 'Student' model, and was trying to create a new
Student in the admin interface, and I got the following error:
Environment:
Request Method: POST
Request URL: http://localhost:8000/admin/student/student/add/
Django Version: 1.0.2 final
Python Version: 2.5.2
Installed
Brilliant. Thanks James.
I went down this path of thinking but tried blank=True instead of
required=False which, when it failed, confused my underslept mind :)
Appreciate it.
Andrew.
On Dec 10, 1:03 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 7:50 PM, tenni <[EMAIL
On Tue, Dec 9, 2008 at 7:50 PM, tenni <[EMAIL PROTECTED]> wrote:
> "optional_field" becomes a required field in the Admin. I assume
> something is overriding the model's blank=True for this field.
Yes. *You* are overriding that.
The moment you override a field's definition in a ModelForm is the
If I do this in admin.py
class UnitAdminModelForm(forms.ModelForm):
optional_field = forms.CharField(widget=WYMEditor())
class Meta:
model = Unit
"optional_field" becomes a required field in the Admin. I assume
something is overriding the model's blank=True for this field.
If
Good point, thanks very much, but I think I'll just live with the way
it currently works.
What I've done is to take a bit more care how and where I place
template tags, and this has improved things somewhat.
On Dec 4, 1:25 am, adelevie <[EMAIL PROTECTED]> wrote:
> You may also want to look at
Thanks a lot !
On Dec 10, 1:24 pm, friggstad <[EMAIL PROTECTED]> wrote:
> It is the human-friendly name used in the admin.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
On Dec 10, 2008, at 1:30 AM, DULMANDAKH Sukhbaatar wrote:
>
>> File
>> "/usr/local/python2.5/lib/python2.5/site-packages/
>> MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/__init__.py",
>> line 74, in Connect
>>
>> File
>> "/usr/local/python2.5/lib/python2.5/site-packages/
>>
On Tue, 2008-12-09 at 16:12 -0800, Chr1s wrote:
>
> ValueError at /vote/add/
>
> invalid literal for int() with base 10: 'AA'
>
> Request Method: POST
> Request URL: http://localhost:8000/vote/add/
> Exception Type: ValueError
> Exception Value:
>
> invalid literal for int()
Hi,
I've looked about but can't find the answer to this.
I'd like to set the limit_choices_to value of a ForeignKey field based
on another selection in the current instance.
i.e. - filter the choices based on another field of the same instance.
something like this:
my_fk.limit_choices_to =
It is the human-friendly name used in the admin.
--~--~-~--~~~---~--~~
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
Hi,
I'm using flatpages to display some static content in a site. The
"about" page is working flawlessly (URL = mysite.com/about) but now
I'm trying to define the index (URL = mysite.com) using flatpages.
I'm having troubles defining the URL in the administration panel:
If I put / in the URL
On Tue, 2008-12-09 at 09:10 -0700, Jeff Anderson wrote:
[...]
> I am running memcached, which does seem to help my sites go faster, but
> it isn't helping the memory footprint go down (obviously.)
Although memcached is usually "the answer" to a lot of caching issues,
it does have that obvious
Hi,
I've seen some code with the following in, but can't find what the
string 'date added' is representing in the documentation.
What is the string for?
models.DateTimeField('date added')
Thank you!
I know it's easy, but it'd take me forever to find out.
ValueError at /vote/add/
invalid literal for int() with base 10: 'AA'
Request Method: POST
Request URL:http://localhost:8000/vote/add/
Exception Type: ValueError
Exception Value:
invalid literal for int() with base 10: 'AA'
Exception Location:
haha yeah, i just submitted a ticket to godaddy. They're usually
really good with getting back.
On Dec 9, 6:31 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 3:22 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> > ok, server time is 2 hours and 11 minutes behind... this could
On Tue, Dec 9, 2008 at 3:22 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> ok, server time is 2 hours and 11 minutes behind... this could explain
> the issue then. The admin section, when creating a new entry takes the
> time current actual time. So it makes 100% sense that django/python is
>
ok, server time is 2 hours and 11 minutes behind... this could explain
the issue then. The admin section, when creating a new entry takes the
time current actual time. So it makes 100% sense that django/python is
reading the incorrect time. I've attempted to update the server time
using the usual
Thanks Daniel Roseman That did the trick. I did not think to do a
lambda
> I _very_ strongly suggest you take some time learning Python. In this
> case, the parens are actually the call operator. Not applying this
> operator results in getting a reference to the function (or whatever
>
On Tue, Dec 9, 2008 at 7:05 PM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> please, maybe anyone now how to perform distinct() filtering for
> certain attribute(column), not the whole objects(rows)? :)
First off - patience. Only 10 hours passed between your original
request and your repeat.
I think it would be good to ask students how they plan to use django.
For myself, we'd like to deploy databases on a web page, and I'm
interested to learn how much of that can be done in python and django,
then what do you add to make the database look pretty for outside
users.
On Dec 8, 11:06
awesome, i will take a look at the server date. It is possible that it
is off.
On Dec 9, 3:57 pm, "Colin Bean" <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> > Server is Red Hat 7, set up by godaddy, its a virtual server. Python
> > 2.5 w/
w00t. Thanks. After a bunch more import statements I finally got it
working. Thanks again!!!
On Dec 9, 4:22 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 9, 9:12 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Still no luck. I have this line added to the top of views.py.
>
> > from
Also, as an aside to all of that--what you're generating is in no way
guaranteed to be unique. If you really need a unique string, use a
UUID or hash of the primary key.
On Dec 9, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]>
wrote:
> On 9 déc, 11:32, Chris <[EMAIL PROTECTED]> wrote:
>
> >
On Dec 9, 9:12 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Still no luck. I have this line added to the top of views.py.
>
> from xxx.register.forms import ContactForm
>
> It can't seem to find forms 'No module named forms'.
>
Sorry, I misread your original post. For some reason you have put your
Thanks Karen.
I removed the custom form from admin.py and added a constructor to the
model:
def __init__(self, *args, **kwargs):
super(BannerImage, self).__init__(*args, **kwargs)
self._meta.get_field('url')._choices = get_urls()
It seems to work now.
Keith
On Dec 9, 2:52 pm, "Karen
On Dec 10, 3:10 am, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> Hello,
>
> First, I'm gonna say that I have DEBUG turned off, and it's not Django's
> fault.
>
> My Django sites seem to eat lots of memory. This is fine, and it isn't a
> huge deal except that I am using all of my VPS's memory plus
Still no luck. I have this line added to the top of views.py.
from xxx.register.forms import ContactForm
It can't seem to find forms 'No module named forms'.
On Dec 9, 3:45 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 9, 8:43 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Thank you.
On Tue, Dec 9, 2008 at 3:57 PM, Colin Bean <[EMAIL PROTECTED]> wrote:
> Ah, didn't realize that it was showing one part of the page and not
> another. Looks like the template tag in the "secondary" section
> queries all of the blog post objects, while the main section uses the
> "latest"
Hi,
I have a question regarding m2m relationship.
I've created I table that contain product and has a manytomany
relationship with an other table that stores images. I would like to
add the image in the product admin form. I don't want to see all the
images in the product table, but just
On Tue, Dec 9, 2008 at 12:16 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> Server is Red Hat 7, set up by godaddy, its a virtual server. Python
> 2.5 w/ mod_python and python-devel installed. running latest django.
>
> I am using webmonkey.com's tutorial for this:
>
On 9 déc, 11:32, Chris <[EMAIL PROTECTED]> wrote:
> Hello,
> when django is running on a server, I want to make a call to:
> random.random(). When I make a call to this again, I can't. I think
> this related to a similar issue datetime.datetime.now() where you
> leave off the () to get a current
On Dec 9, 8:43 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Thank you. That cleared that up. Now getting the error. "global name
> 'ContactForm' is not defined" in my 'views.py' file. Any ideas?
>
Well, as with all Python code, if you define an object in one file and
refer to it in another, you
On Dec 9, 7:34 pm, Chris <[EMAIL PROTECTED]> wrote:
> Here is a code snippet:http://dpaste.com/97475/so basically when I
> login to the backend and try to add a couple rows. I get the same
> random id each time.
As you might realise, what's happening is that Django is evaluating
your call to
Thank you. That cleared that up. Now getting the error. "global name
'ContactForm' is not defined" in my 'views.py' file. Any ideas?
On Dec 9, 3:35 pm, Daniel Roseman <[EMAIL PROTECTED]>
wrote:
> On Dec 9, 8:23 pm, prem1er <[EMAIL PROTECTED]> wrote:
>
> > Trying to follow along with the Form
On Dec 9, 8:23 pm, prem1er <[EMAIL PROTECTED]> wrote:
> Trying to follow along with the Form Tutorial on the Django site and
> I'm running into a problem. I keep getting the error page 'module'
> object has not attribute 'ContactForm', when I just simply copy and
> pasted the code from the
I'm looking for someone in the Johannesburg/Pretoria area who is
willing to collaborate with me on some aspects of a Django app. I have
done quite alot of work on getting the business logic right, but need
some guidance on many of the technical aspects. Anyone available, and
willing to assist?
Trying to follow along with the Form Tutorial on the Django site and
I'm running into a problem. I keep getting the error page 'module'
object has not attribute 'ContactForm', when I just simply copy and
pasted the code from the tutorial into my models.py. Here is my
source. I feel like it has
Server is Red Hat 7, set up by godaddy, its a virtual server. Python
2.5 w/ mod_python and python-devel installed. running latest django.
I am using webmonkey.com's tutorial for this:
http://www.webmonkey.com/tutorial/Install_Django_and_Build_Your_First_App
so you can find the blog app as well
On Sun, Dec 7, 2008 at 7:32 PM, garagefan <[EMAIL PROTECTED]> wrote:
>
> following another tutorial to build a blog (webmonkey.com's) at it was
> rather frustrating to see nothing show up after creating a new blog...
>
> the admin section seems to see these right away, as they are there as
> soon
On Tue, Dec 9, 2008 at 1:58 PM, lingrlongr <[EMAIL PROTECTED]> wrote:
>
> I have a function called get_urls that returns a list of absolute_urls
> for various models in the same project. This function is used for
> another model in a way so that when a particular model appears on the
> site, I
On Tue, Dec 9, 2008 at 9:33 AM, garagefan <[EMAIL PROTECTED]> wrote:
>
> sure thing:
>
> from django.conf.urls.defaults import *
> from mysite.blog.models import Entry
> from tagging.views import tagged_object_list
>
> info_dict = {
>'queryset': Entry.objects.filter(status=1),
>
Recently, I tried to add multiple decorators to FormPreview
http://docs.djangoproject.com/en/dev/ref/contrib/formtools/form-preview/
The only documented examples of how to accomplish this I could find
were here...
Here is a code snippet: http://dpaste.com/97475/ so basically when I
login to the backend and try to add a couple rows. I get the same
random id each time.
On Dec 9, 10:27 am, Jeff FW <[EMAIL PROTECTED]> wrote:
> Can you show me exactly what you're trying to do? That would make it
> much easier
Hello,
Sorry thats not the real template, it's this one:
{% for d in data %}
{{ d.pregunta.id }}
{{ d.pregunta.descripcion_pregunta}}
{{ d.respuesta }}
{{
d.pregunta.tipo_pregunta.nombre_tipo }}
Hello,
This is my template(actually is only the part where the for cycle
returns the results i need):
{% for r in rendicion %}
{{forloop.counter}}
{{r.comuna.nom_comuna|upper}}
{{r.comuna.region.nom_region}}
> Right in your urls.py there should be commented out lines that's
> specifically tells you what to do to get the docs working. Once you do
> that then you will see the link.
Doh! I had deleted all that. Thanks, that did the trick (along with
adding admindocs to INSTALLED_APPS).
- Aparajita
I have a function called get_urls that returns a list of absolute_urls
for various models in the same project. This function is used for
another model in a way so that when a particular model appears on the
site, I can choose which part of the site this model links to.
# utils.py
def
Thanks so much for the help! I deleted the database, made the changes
you suggested and ran syncdb again. I have two lingering issues.
1) At the django admin interface, I still only see a place to enter
data for 'Artist', and none of the tables that follow it in models.py
appear (the updated
> First, I'm gonna say that I have DEBUG turned off, and it's not Django's
> fault.
>
> My Django sites seem to eat lots of memory. This is fine, and it isn't a
> huge deal except that I am using all of my VPS's memory plus swap. The
> real solution is to upgrade memory on the VPS, but I'm a poor
Can you show me exactly what you're trying to do? That would make it
much easier to help you.
-Jeff
On Dec 9, 1:19 pm, Chris <[EMAIL PROTECTED]> wrote:
> I found this snippet:http://www.djangosnippets.org/snippets/814/and
> noticed that it does not work as intended do to the issue that I
>
I found this snippet: http://www.djangosnippets.org/snippets/814/ and
noticed that it does not work as intended do to the issue that I
described. I tried passing it as default instead of using the save
method but does not work and since I am not passing random to default
directly, I cannot do
On Wed, Dec 10, 2008 at 12:50 AM, aparajita
<[EMAIL PROTECTED]> wrote:
> I am using django release 1.0.2, nothing modified. My admin interface
> works fine, but the documentation link never appears. I have
> 'django.middleware.doc.XViewMiddleware' in the list of middleware, I
> have my IP address
> im a bloody django and python beginner and right now playing arround
> with the code provided
> onhttp://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser
>
> on storing the entry in the admin following error occur:
>
> AttributeError at /admin/news/post/add/
>
> 'CommentFormFormSet'
Right in your urls.py there should be commented out lines that's
specifically tells you what to do to get the docs working. Once you do
that then you will see the link.
Steve
On 12/9/08, aparajita <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I am using django release 1.0.2, nothing modified. My admin
Hi,
I am using django release 1.0.2, nothing modified. My admin interface
works fine, but the documentation link never appears. I have
'django.middleware.doc.XViewMiddleware' in the list of middleware, I
have my IP address listed in INTERNAL_IPS.
Any ideas?
- Aparajiita
The problem with this solution is that you are unable to sort and/or
filter by anything you "wire" to the User admin page. #9463 is one I
have posted a bit ago.
On Dec 9, 9:43 am, "Ronny Haryanto" <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 9, 2008 at 8:58 PM, mahesh <[EMAIL PROTECTED]> wrote:
> >
On Tue, Dec 9, 2008 at 8:58 PM, mahesh <[EMAIL PROTECTED]> wrote:
> How do wire Userprofile to UserAdmin ?
Here's one way to do it:
# admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from myproj.myapp.models
> File
> "/usr/local/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/__init__.py",
> line 74, in Connect
>
> File
> "/usr/local/python2.5/lib/python2.5/site-packages/MySQL_python-1.2.2-py2.5-linux-i686.egg/MySQLdb/connections.py",
> line 170, in
hello group,
im a bloody django and python beginner and right now playing arround
with the code provided on
http://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser
on storing the entry in the admin following error occur:
AttributeError at /admin/news/post/add/
'CommentFormFormSet'
This may not even be a Django problem, but I saw this on two of my dev
sites today, both running the same code base, our version of django is
from the trunk, and maybe a week or so old. One site was running the
light weight server, the other site was running apache/mod_python. Both
are connected
I had the same issue... you need to do two things...
copy this into the setup.py
from django.conf import settings
settings.configure()
and make sure you have python-devel installed
On Dec 9, 8:24 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> hi
> I got it from trunk,and the version is
Hello,
First, I'm gonna say that I have DEBUG turned off, and it's not Django's
fault.
My Django sites seem to eat lots of memory. This is fine, and it isn't a
huge deal except that I am using all of my VPS's memory plus swap. The
real solution is to upgrade memory on the VPS, but I'm a poor
Try typing the following:
python manage.py shell
from the python shell, type:
import tagging
tagging.VERSION
Regards
On Dec 9, 8:24 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> hi
> I got it from trunk,and the version is 0.3. After I installed
> tagging , I cannot import it. The
On 9 déc, 13:20, Alex Jonsson <[EMAIL PROTECTED]> wrote:
> Hey everyone,
>
> My model looks like the following:
>
> http://dpaste.com/97293/
>
> An album has a release date for every format, and one format can only
> have one release date per album. Hopefully you get what I'm trying to
> achieve
Hello Kian,
Could you show us your template too? And why are you importing the csv
module when you're not using it? I would use the csv module to
generate the CSV completely in the view, but that's me.
2008/12/9, garces.85 <[EMAIL PROTECTED]>:
>
> Hello Kian,
>
> I have already tried this
sure thing:
from django.conf.urls.defaults import *
from mysite.blog.models import Entry
from tagging.views import tagged_object_list
info_dict = {
'queryset': Entry.objects.filter(status=1),
'date_field': 'pub_date',
}
urlpatterns = patterns('django.views.generic.date_based',
Hi,
def foo(request):
return django.http.HttpResponseRedirect(newlocation)
newlocation can be an URL. I create them with
django.core.urlresolvers.reverse().
Thomas
nbv4 schrieb:
> If the user goes to /foobar, I want it to redirect him to /foobar-page-
> XX, XX being the last
hi
I got it from trunk,and the version is 0.3. After I installed
tagging , I cannot import it. The error information is following:
Thank you very much
---
IDLE 1.2.2
>>> import tagging
Traceback (most recent call last):
File
Understood. Thanks.
On 9 Dec 2008, at 10:18, Graham Dumpleton wrote:
>
>
>
> On Dec 9, 8:05 pm, Ben Eliott <[EMAIL PROTECTED]> wrote:
>> Graham,
>> Thank you for coming back personally to such a lowly wsgi question! I
>> started reading your email and thinking the answer was 'no', then
>> ended
Chris,
It depends on where you're calling random.random(). If you're trying
to do it in a model definition, then you're always going to have the
value it chose when it first executed the model's class definition--
when the server starts up. In that case, you should be able to pass
an argument
UserProfile
How do wire Userprofile to UserAdmin ?
I want to add some more fields to user class. I have added one class
in polls/admin.py (polls being my app) and added following attribute
in settings.py
>> code snippet <<
AUTH_PROFILE_MODULE='polls.MySiteProfile'
model.py
gender = (
Hi,
I guess the subject sums it up.. Basicly, in the admin we have:
City:
But oustide there is no 'class="required"'. Is there a way to define
this so that it shows up? That would make my life much easier since I
could just code some javascript to do client side validation based on
css
To get the plus icon back, you need to wrap the field in a
RelatedFieldWidgetWrapper. Here's an example from my code--obviously,
you'll have to adapt it to fit your situation.
class CategoryChoiceField(forms.ModelChoiceField):
def __init__(self, *args, **kwargs):
Hello Kian,
I have already tried this response, the problem is that in my excel
output i get this strange characters.
For example all my grammar words return like weird characters.
Example :
If i have this word : ( Módulo) It becomes something like this : (MA3-
dulo).
I am working with a latin
http://docs.djangoproject.com/en/dev/ref/request-response/#httpresponse-subclasses
http://docs.djangoproject.com/en/dev/ref/contrib/redirects/#ref-contrib-redirects
On Tue, Dec 9, 2008 at 16:25, nbv4 <[EMAIL PROTECTED]> wrote:
>
> If the user goes to /foobar, I want it to redirect him to
If the user goes to /foobar, I want it to redirect him to /foobar-page-
XX, XX being the last page. I have a this in my urlconf"
(r'^foobar/
$',
'project.main.views.foobar_no_page', ),
(r'^foobar-page-(?P\d{1,4})/$',
'project.main.views.foobar', ),
foobar() in my views in my main function,
That's rigth you hit the point
followed your advice and with these lines i resolved my problem, got
modelform filtered by a custom query
yaho
the model (part of it)
class Indicacion(models.Model):
'''
@author: Abel Bolaños Martínez
@contact: [EMAIL
ok, I've added coltrane!..rock on!
I added an admin.py file to the coltrane folder..
---
#admin.py
from django.contrib import admin
from coltrane.models import Category
admin.site.register(Category)
hi,
I am trying to get list of selected checkbox from the listing.
here is my code:
html
{% for companies in companylist.object_list %}
{% endfor %}
{% if is_paginated %}
Prev
| Page {{cur_page}} of {{paginator_company_list.num_pages}} |
Next
{% endif %}
and
>>>import sys; sys.path
['', '/home/mark/django_projects',
'/home/mark/django_projects/coltrane',
'/usr/lib/python25.zip',
'/usr/lib/python2.5',
'/usr/lib/python2.5/plat-linux2',
'/usr/lib/python2.5/lib-tk',
'/usr/lib/python2.5/lib-dynload',
'/usr/local/lib/python2.5/site-packages',
Hey everyone,
My model looks like the following:
http://dpaste.com/97293/
An album has a release date for every format, and one format can only
have one release date per album. Hopefully you get what I'm trying to
achieve here ;)
The thing is though, that in my Album model I specify a
from tutorial part 03:
from django.http import Http404
# ...
def detail(request, poll_id):
try:
p = Poll.objects.get(pk=poll_id)
except Poll.DoesNotExist:
raise Http404
return render_to_response('polls/detail.html', {'poll': p})
I'm working through 'practical django projects'
on page 46, in order to develop stanalone application, I need to add
my django 'project' to the python path. therefore..
export PYTHONPATH=/home/mark/django_projects/:$PYTHONPATH
then a little later in the tutorial after setting up the 'coltrane
Well, looks that the ModelChoiceField solves the problem except of the
plus icon
On Dec 9, 12:34 pm, Eugene Mirotin <[EMAIL PROTECTED]> wrote:
> Hello. I'm working on the custom admin page that will serve batch
> items creation based on the uploaded file.
> All these items should be linked to
> I am using django tagging and have problems adding tags to an object.
>
> There are 2 methods that enable adding a tag:
> - add_tag()
> - update_tags()
>
> --
> for tag in parse_inputs(form.cleaned_data['tags']):
> Tag.objects.add_tag(tag)
>
Hello. I'm working on the custom admin page that will serve batch
items creation based on the uploaded file.
All these items should be linked to the single foreign key item.
This item should be selected on the form.
Of course, I can investigate the inner structure of the rendered admin
pages and
Hello,
when django is running on a server, I want to make a call to:
random.random(). When I make a call to this again, I can't. I think
this related to a similar issue datetime.datetime.now() where you
leave off the () to get a current date each time each time you call
it. If you dont do that,
On Dec 9, 8:05 pm, Ben Eliott <[EMAIL PROTECTED]> wrote:
> Graham,
> Thank you for coming back personally to such a lowly wsgi question! I
> started reading your email and thinking the answer was 'no', then
> ended up thinking 'definitely maybe'. I'll keep an eye out in case you
> post
please, maybe anyone now how to perform distinct() filtering for
certain attribute(column), not the whole objects(rows)? :)
In case not - please tell me what's the best practice when coming to a
situation when django orm is not powerfull enough. Can writting custom
sql queries become a serious
I'll give it a go :) Thanks for your help Ben.
On Dec 9, 9:50 am, Ben Eliott <[EMAIL PROTECTED]> wrote:
> hmm, don't know. that's the documented approach. you might want to
> investigate intermediary tables/models etc.
>
> On 9 Dec 2008, at 09:24, Darthmahon wrote:
>
>
>
> > Ahh yes possibly.
File uploading is explained in detail at
http://docs.djangoproject.com/en/dev/topics/http/file-uploads/
In short you create a form consisting of a file field:
class UploadFileForm(forms.Form):
title = forms.CharField(max_length=50)
file = forms.FileField()
then write a view function
hmm, don't know. that's the documented approach. you might want to
investigate intermediary tables/models etc.
On 9 Dec 2008, at 09:24, Darthmahon wrote:
>
> Ahh yes possibly. Any downsides to using this?
>
> On Dec 9, 9:19 am, Ben Eliott <[EMAIL PROTECTED]> wrote:
>> Do you want something
request.FILES
If this is what you mean, I think this is kind of django 101, i'd
recommend having a solid read through the docs which cover all these
kind of bases really well.
On 9 Dec 2008, at 09:30, Vicky wrote:
>
> If we send a file by post method to a django function how can we
>
On Dec 9, 5:02 am, djan <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm running OpenSuSE-11.0 with the lastest version of django and
> sqlite3.
> When I enter the admin interface to enter data into my database, I got
> the error:
>
> OperationalError at /admin/archive/artist/add/
>
> table
1 - 100 of 112 matches
Mail list logo