hi friends
I 'm facing a wried behavior of Imageupload
In Models.py
class Market(...)
title_name=models.CharField(max_length=125)
photo1 = models.ImageField(upload_to= 'img/marketplace/%Y/%m/
%d', null=True, blank=True)
In views.py
def postyour_adds(request):
if request.method=
Hey,
On Fri, Jul 24, 2009 at 6:46 AM, Mike Dewhirst wrote:
>
> I'm new to Django and want to express a self-referencing design
> feature to link clients in the same table with each other. Django is
> currently objecting to this. Could you please point me to
> documentation which will let me figur
On Fri, Jul 24, 2009 at 5:32 AM, sico wrote:
>
> Hi,
>
> I want to be able to edit fields from several different models on the
> same form/view.
>
> The models are related one-to-one... can they be defined as "Inline"
> forms in the admin system?? The documentation doesn't make any
> mention of u
On Thu, Jul 23, 2009 at 11:36 PM, James Bennett wrote:
> Meanwhile, the codebase stays much simpler and avoids some pitfalls
> with potential resource and state leaks.
All pgpool2 does to reset the session to avoid all of these pitfalls
is issue "ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAU
I'm new to Django and want to express a self-referencing design
feature to link clients in the same table with each other. Django is
currently objecting to this. Could you please point me to
documentation which will let me figure it out?
This is my models.py in a play project using Django from sv
Oh, sweet, thanks! I read that a few times before I posted but I
couldn't get the inlines to work-- I was using the model with the
large field, the manytomany field, with the raw_id_fields=... I had
to use the INLINE model to display it. Thanks again!
On Jul 23, 12:45 pm, Rajesh D wrote:
> O
Try those :
*Concept ,Ideas and Basics :*
http://www.theotherblog.com/Articles/2009/06/02/extending-the-django-admin-interface/
Tom explain the main concept .
*Slideshow ( reference ) :*and this slideshow is outstanding as well :
http://www.slideshare.net/lincolnloop/customizing-the-django-adm
On Thu, Jul 23, 2009 at 9:50 PM, Glenn Maynard wrote:
> In this case, that's a terrible-performance-by-default approach.
> (It's also not a default, but the only behavior, but I'll probably
> submit a patch to add a setting for this if I don't hit any major
> problems.)
Please do a bit more resea
Hi,
I want to be able to edit fields from several different models on the
same form/view.
The models are related one-to-one... can they be defined as "Inline"
forms in the admin system?? The documentation doesn't make any
mention of using inline forms for anything except parent child
relations
On Thu, Jul 23, 2009 at 10:02 PM, Carlos A. Carnero
Delgado wrote:
> On Thu, Jul 23, 2009 at 5:24 PM, Glenn Maynard wrote:
>> Why is each thread's database connection closed after each request?
>
> I believe that this is related to Django's shared-nothing-by-default approach.
In this case, that's
On Thu, Jul 23, 2009 at 5:43 PM, Emily
Rodgers wrote:
>
> Hi all,
>
> I am currently working on some web apps that use django for the back
> end, and extjs for the front end (using JSON to pass data between the
> two).
>
> I am getting to the point where I am going to have to start doing some
> fo
Hi,
On Thu, Jul 23, 2009 at 5:24 PM, Glenn Maynard wrote:
> Why is each thread's database connection closed after each request?
I believe that this is related to Django's shared-nothing-by-default approach.
HTH,
Carlos.
--~--~-~--~~~---~--~~
You received this me
On Thu, Jul 23, 2009 at 11:55 PM, Adam Seering wrote:
>
> Hey folks,
> I have a PostgreSQL stored procedure that does some fairly complex
> logic to query/filter a particular table (though it ultimately does
> return rows straight from that table). I'm trying to call this stored
> procedur
On Thu, Jul 23, 2009 at 9:31 PM, Rusty Greer wrote:
>
> how do i create a query on the size of an image?
>
> for example:
> class Image(models.Model):
>
>image = models.ImageField(upload_to=upload_to('images'), db_index=True)
>
>
> if i try something like:
>
>for image in Image.objects.fi
Hello, developers!
Please help me with one problem. I spent 2 days attempting to solve
it. And now i have some solution, but i don't like it.
My application manages music tracks.
There is models: Artist, Album, Track.
Simply:
class Artist:
name = CharField()
class Album:
title = CharField(
On Jul 24, 8:53 am, James Matthews wrote:
> Django depends more on the python interpreter. If it really matters
> recompile python to take advantage of your machine. I am sure you will see
> some nice improvements
>
> On Fri, Jul 24, 2009 at 12:08 AM, Some Guy wrote:
>
> > Not sure about my an
Hi,
Daniel Roseman wrote:
> > ... http://www.webmonkey.com/tutorial/...
> This is a very misleading tutorial, and I wouldn't recommend it.
> You could make this work, though. ...
Not being the OP i still want to thank you for these hints, Daniel. Makes a
beginner catch a glimpse ...
Could yo
Django depends more on the python interpreter. If it really matters
recompile python to take advantage of your machine. I am sure you will see
some nice improvements
On Fri, Jul 24, 2009 at 12:08 AM, Some Guy wrote:
>
> Not sure about my answer but
> I think it matters more that the webserve
On Jul 21, 3:18 pm, Wayne Koorts wrote:
> Hi Steve,
>
> > We have an application where we periodically import data from an
> > external vendor, and the process is mostly automated, but we need to
> > review the data before having it go live.
>
> > We were considering an option where we would run
how do i create a query on the size of an image?
for example:
class Image(models.Model):
image = models.ImageField(upload_to=upload_to('images'), db_index=True)
if i try something like:
for image in Image.objects.filter(image__height_field__gte=100):
# do something
i get th
Hi.
I want to create phone book. I want that this phone book list will be
ordered by number of dialing this number. I think of using two tables
one with phone numbers and one for phone dialing statistics (how many
times user dialed number). Each user has his own ordering rule based
on his user-na
On Jul 23, 12:41 am, Russell Keith-Magee
wrote:
> The decision about splitting this into more than one view is
> approaching an 'inmates running the asylum' issue [1]. Work out what
> UI will work for your users. Then work out how to make that
> implementation work. Don't let the implementation d
On Jul 23, 12:41 am, Russell Keith-Magee
wrote:
> This sounds like you are on the right track. My only other suggestion
> is that it might be worth looking into using FormSets to simplify the
> logic for displaying multiple Payment forms on the page.
Thanks for your input. Just to give you an up
On Thu, Jul 23, 2009 at 11:55 AM, Adam Seering wrote:
> I have a PostgreSQL stored procedure that does some fairly complex
> logic to query/filter a particular table (though it ultimately does
> return rows straight from that table). I'm trying to call this stored
> procedure from within D
On Jul 23, 9:17 pm, James wrote:
> Based some tutorials and code examples, I'm attempting to modify my
> admin page by adding "admin.py" in my project directory. However, the
> changes don't seem to make a lick of difference.
>
> This (http://www.webmonkey.com/tutorial/
> Install_Django_and_Build
Why is each thread's database connection closed after each request?
Opening a database connection is expensive; it's taking 150ms. Even
10ms would be far too much, for a request that otherwise takes only
30ms. Django threads are reused in FastCGI, and database connections
are reusable; why do t
On Thu, Jul 23, 2009 at 3:09 PM, Matthias Kestenholz <
matthias.kestenh...@gmail.com> wrote:
>
> Well, there is a big difference between the two. include() takes the
> python path to an URLconf file while the other form takes a view.
>
> You should read the documentation on this page if you haven't
there should have been a comma after the word not.
On Thu, Jul 23, 2009 at 2:40 PM, Saketh wrote:
> Joshua, could you clarify what you mean by "not in the url pattern list?"
>
> Sincerely,
> Saketh
>
> --
> Saketh Bhamidipati
> Harvard College '11
> http://people.fas.harvard.edu/~svbhamid/
>
>
>
Not sure about my answer but
I think it matters more that the webserver you are using can take
advantage of multicore (i.e. mod_python instances running in their own
thread.)
On Jul 23, 10:26 am, ihome wrote:
> Has django been designed to take advantage of multicore machine? Is
> there a way
Based some tutorials and code examples, I'm attempting to modify my
admin page by adding "admin.py" in my project directory. However, the
changes don't seem to make a lick of difference.
This (http://www.webmonkey.com/tutorial/
Install_Django_and_Build_Your_First_App#Check_your_head) implies that
class MyModel (models.Model):
name = models.CharField(...)
class MyProxy (MyModel):
class Meta:
proxy = True
ordering = ["name"]
class MyAdmin (admin.ModelAdmin):
pass
admin.site.register(MyProxy, MyAdmin)
The above example does not seem to honor the ordering field within the
adm
On Jul 22, 11:17 pm, knicholes wrote:
> Hey,
>
> I used the admin to display a manytomany field (that had over 60,000
> entries) and used raw_id_field = ('hugeDatabaseField'). This took
> care of the problem, but I wanted to be able to sort my manytomany
> field, so I added an intermediary cla
On Jul 21, 9:10 am, Philippe Josse wrote:
> Hi there,
>
> I would like to have your feedback on the way I am running daemon scripts
> for my Django/ Python app. I know this is definitely not the "one best way",
> but this is a solution I came up with that seemed simple to implement. (I am
> a r
> Lets say I have two models Street and House, related by a foreign key
> thus:
>
> class House(models.Model):
> house_number = models.CharField(max_length=16)
> street = models.ForeignKey(Street)
>
> In the admin area, the Change House page displays a list widget by
> which to select the
Looks like I learned something too. :)
Sincerely,
Saketh
On Thu, Jul 23, 2009 at 1:32 PM, Sonal Breed wrote:
>
> Saketh,
> I got the problem, it was the quotes around username and localhost,
> The command for mysql should be
> GRANT ALL ON django_db.* TO sonal@'ocalhost IDENTIFIED BY
> 'sonal';
Saketh,
I got the problem, it was the quotes around username and localhost,
The command for mysql should be
GRANT ALL ON django_db.* TO sonal@'ocalhost IDENTIFIED BY
'sonal';
http://www.webdevelopersnotes.com/tutorials/sql/mysql_primer_creating_a_database.php3
Thanks,
Sonal.
On Jul 23, 10:03 am
Has django been designed to take advantage of multicore machine? Is
there a way to boost the performance of a django server on multicore
machine? Any thoughts? Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"
Hello saketh,
The name of the db is mygodb, i just happened to give the example of
Django_db in mysql console.
I am still getting the error. Does anybody know the solution to this??
Any help will be really appreciated,
Sonal.
On Jul 23, 9:47 am, Sonal Breed wrote:
> Yes , the name of the datab
Yes , the name of the database is mygodb..
On Jul 23, 9:45 am, Saketh wrote:
> You seem to be accessing 'mygodb' from your django config, for which
> so...@localhost might not have permissions. Is this the case?
>
> Sincerely,
> Saketh
>
> On Thu, Jul 23, 2009 at 12:42 PM, Sonal Breed wrote:
>
You seem to be accessing 'mygodb' from your django config, for which
so...@localhost might not have permissions. Is this the case?
Sincerely,
Saketh
On Thu, Jul 23, 2009 at 12:42 PM, Sonal Breed wrote:
>
> Hi all,
>
> I am migrating my project from sqlite3 to mysql.
> Installed mysql and mysqld
Hi all,
I am migrating my project from sqlite3 to mysql.
Installed mysql and mysqldb on my machine and executed following:
mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.51a-3ubuntu5.1 (Ubuntu)
Type
On Thu, Jul 23, 2009 at 5:33 PM, Joshua Russo wrote:
> On Thu, Jul 23, 2009 at 2:18 PM, Matthias Kestenholz
> wrote:
>>
>> On Thu, Jul 23, 2009 at 4:51 PM, Joshua Russo
>> wrote:
>> >
>> > Is there any difference between using import() versus not in the url
>> > pattern list?
>> > (r'^accounts
Hey folks,
I have a PostgreSQL stored procedure that does some fairly complex
logic to query/filter a particular table (though it ultimately does
return rows straight from that table). I'm trying to call this stored
procedure from within Django, and execute additional filters/etc on th
that should be
@login_required
def index(request):
...
as far as i know, pretty sure your () are the problem
Asinox wrote:
> Hi guys, im trying to use the login and logout functions of Django,
> but my @login_required() dont work, dont redirecto to the login form
> and show the view where the
Joshua, could you clarify what you mean by "not in the url pattern list?"
Sincerely,
Saketh
--
Saketh Bhamidipati
Harvard College '11
http://people.fas.harvard.edu/~svbhamid/
On Thu, Jul 23, 2009 at 11:33 AM, Joshua Russo wrote:
> On Thu, Jul 23, 2009 at 2:18 PM, Matthias Kestenholz <
> matthi
On Thu, Jul 23, 2009 at 2:18 PM, Matthias Kestenholz <
matthias.kestenh...@gmail.com> wrote:
>
> On Thu, Jul 23, 2009 at 4:51 PM, Joshua Russo
> wrote:
> >
> > Is there any difference between using import() versus not in the url
> > pattern list?
> >(r'^accounts/login/$', 'django.contrib.auth.
Hi guys, im trying to use the login and logout functions of Django,
but my @login_required() dont work, dont redirecto to the login form
and show the view where the user need to be logged...
VIEW
from django.shortcuts import render_to_response, get_object_or_404,
Http404
from django.contrib.auth.
On Thu, Jul 23, 2009 at 4:51 PM, Joshua Russo wrote:
>
> Is there any difference between using import() versus not in the url
> pattern list?
> (r'^accounts/login/$', 'django.contrib.auth.views.login'),
> (r'^admin/doc/', include('django.contrib.admindocs.urls')),
Are you asking about impor
On 23 Jul 2009, at 16:30 , nbv4 wrote:
> I'm looking into adding prettier URLs into my site with the help of
> slugs. I've never done something like this before, so I'm doing a lot
> of reading and am having trouble "getting" slugs. When creating URLs,
> couldn't you just do do something like "exa
Is there any difference between using import() versus not in the url
pattern list?
(r'^accounts/login/$', 'django.contrib.auth.views.login'),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
--~--~-~--~~~---~--~~
You received this message because
On Thu, Jul 23, 2009 at 10:30 AM, nbv4 wrote:
>
> I'm looking into adding prettier URLs into my site with the help of
> slugs. I've never done something like this before, so I'm doing a lot
> of reading and am having trouble "getting" slugs. When creating URLs,
> couldn't you just do do something
My understanding of the slug field is that prettier URLs are the main
point.
"Slug" is a newspaper-industry term, and since Django has its roots
there, it's now a Django term.
Django does' in fact, contain a slugify function:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#slugi
I'm looking into adding prettier URLs into my site with the help of
slugs. I've never done something like this before, so I'm doing a lot
of reading and am having trouble "getting" slugs. When creating URLs,
couldn't you just do do something like "example.com/45/slug-goes-
here"? Then have the vie
Why not just use the automatic "id" field as the primary key?
--~--~-~--~~~---~--~~
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
Do you know for certain that indata contains a value before you try
the objects.get()?
If you are getting an error like "no value found," it sounds like you
might not. If you're getting something like "no such object," then it
would be a different problem.
Is the field "word" in your model
On Thu, 2009-07-23 at 14:11 +0100, Jeremy Sule wrote:
> Hi everyone,
>
> I use pdb a lot and just drop "import pdb; pdb.set_trace()" here and
> there in my code.
> Often I find I have to change my code and do the change in the source
> code and save it.
>
> The auto reload feature of django then
I reply to myself...
My mistake was a confusion between db_column and to_field so the
mistake was to put db_column='id_schedule' in
id_parent = models.ForeignKey("self",db_column='id_schedule')
because like that django will use the column id_schedule for
id_parent
Instead I have to use
Hi everyone,
I use pdb a lot and just drop "import pdb; pdb.set_trace()" here and there
in my code.
Often I find I have to change my code and do the change in the source code
and save it.
The auto reload feature of django then reloads the files and restarts the
development server (nice).
The pro
Hi,
I am using Django version 1.0.2 final with Python 2.5.2
I have a model called Scheduler in which I have a colomn (called
"parent_id") which define a recursive relationship.
I defined it like this :
class Scheduler(models.Model):
id_schedule = models.AutoField(primary_key=True)
Hello ,
I am customizing Django-admin for an application am working on . so
far the customization is working file , added some views . but I am
wondering how to change the records link in change_list display to
display an info page instead of change form ?!
in this blog post :http://www.theother
My requirement is ,user uploaded image has to be saved in Database
after a custom validation for size and has to display to user.
In models.py
class Marketplace(models.Model):
title_name=models.CharField(max_length=125)
photo1 = models.ImageField(upload_to= 'img/marketplace/%Y/
I am sorry for the noise: The slug primary key of the inline model
needs to be displayed. Now it works. Nevertheless silently ignoring
errors like admin does sometimes is bad.
Thomas Guettler schrieb:
> ... replying to myself
>
> In django trunk this was fixed.
> http://code.djangoproject.com/ti
Oh no, how stupid of me. First i register the models in admin.py, and
then i ask how to get rid of them :/
Thank you for your answer. I think its time for a break.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
On Thursday 23 Jul 2009 4:45:29 pm rvandam wrote:
> I got a bit lost in the documentation.
>
> The Django admin panel (1.0.2) shows every model class from my app.I
> have 10 classes, and I want to reduce the classes shown to 2. I can
> modify the other classes because the use of ForeignKeys
>
> Wh
On Thursday 23 Jul 2009 2:58:25 pm gopinath_g wrote:
> Hi friends,
> I am currently working on django .But i feel writing templates
> is a tough job for me because i am terrific at design. Can you provide
> me sources where can get the ready made templates for django
> especially.
I assum
I got a bit lost in the documentation.
The Django admin panel (1.0.2) shows every model class from my app.I
have 10 classes, and I want to reduce the classes shown to 2. I can
modify the other classes because the use of ForeignKeys
What is the best way to accomplish this?
--~--~-~--~---
Hi all,
I have an app for storing historical data for stocks, which I
automatically fetch on a daily basis from Yahoo using the exellent
matplotlib. I have split this into two models, something like this:
class Stock(models.Model):
ticker=models.CharField(max_length=30)
name=models.Cha
Hi friends,
I am currently working on django .But i feel writing templates
is a tough job for me because i am terrific at design. Can you provide
me sources where can get the ready made templates for django
especially.
--~--~-~--~~~---~--~~
You received thi
reinstall the django to the latest development version of the trunk solve
the issue , thank you
On Thu, Jul 23, 2009 at 10:39 AM, Dr.Hamza Mousa wrote:
> Thanks again Russell
>
> The admin templates i put in /templates/admin is working very well the css
> is extended and also customize the base
Hi all,
I am currently working on some web apps that use django for the back
end, and extjs for the front end (using JSON to pass data between the
two).
I am getting to the point where I am going to have to start doing some
form integration. Has anyone done this lately (with the latest version
o
... replying to myself
In django trunk this was fixed.
http://code.djangoproject.com/ticket/10992
Still looking for a solution in 1_0_X. Unfortunately I don't get a stacktrace,
but the inlines are just missing.
TEMPLATE_STRING_IF_INVALID does not get used.
Thomas
Thomas Guettler schrieb:
>
On Jul 23, 10:09 am, Goldy wrote:
> Hi,
>
> I can generate a specific image using the following from the Django
> book.
>
> ---
> ---
> from django.http import HttpResponse
>
> def my_image(request):
> image_
Hi,
today I created a model with a slug field as primary key.
I discovered that it brings problems in the admin interface.
1. Inlines are not possible. The don't get displayed and if I submit I get
"ManagementForm data is missing or has been
tampered with".
Both ("parent" and inline) models ha
Hi,
I can generate a specific image using the following from the Django
book.
--
from django.http import HttpResponse
def my_image(request):
image_data = open("/path/to/my/image.png", "rb").read()
re
I have Django 1.0 and in views.py have following definition:
def vplayer(request,indata):
path_data=szj.objects.get(word=indata).file_path
context=RequestContext(request, {
"indata":path_data,
})
return render_to_response("vplayer.html",context)
Th
Hello
Diango have any build-in method to decode that url?
>>> from django.utils.http import urlquote_plus
>>> url = urlquote_plus('zażółć gęśłą jaźń')
>>> print url
za%C5%BC%C3%B3%C5%82%C4%87+g%C4%99%C5%9B%C5%82%C4%85+ja%C5%BA%C5%84
or this is the best way?
from urllib import unquote_plus
>>> pri
Thanks again Russell
The admin templates i put in /templates/admin is working very well the css
is extended and also customize the base template file ( still working thu )
( forget to say i already set the template dir in settings.py : sorry ) , i
also registered the application .
yes the admin
On Thu, Jul 23, 2009 at 2:30 PM, Dr.Hamza Mousa wrote:
> Hi Russell
>
> The admin templates i copied into /templates/admin/ .
>
> The idea : i need to customize the admin for a project am working on .
>
> -details :
>
> installed django RC 1.1 , ubuntu linux 9.04 .
>
> so i ran :
>
> django-admin.
78 matches
Mail list logo