Modify Content-Type to play MP3?

2010-04-17 Thread The Danny Bos
Heya, I'm trying to modify the content-type of a page to play an MP3. Basically, instead of pointing directly to an MP3, I'm pointing to a view in Django to add some stats to the database etc, after all that baloney is done, I want to go ahead and stream the track. Is there a way to do this, I

Re: How to change the look of the main admin site page?

2010-04-17 Thread Caumons
Yes, this is what actually I need. But I do not know how to apply that in the default admin index page. If I kwew how to do that, the problem would be solved. Do you know if there is a similar way to apply the ordering in this page? Thanks. On 18 abr, 06:14, backdoc wrote:

Re: How to change the look of the main admin site page?

2010-04-17 Thread backdoc
I think you are looking for something like this to your model class: class Meta: ordering = ('lname', 'fname') So, you would have something like: class MyModel(models.Model): fields = SOMEFIELDS(.) class Meta: ordering = ('some', 'column', 'names') On Sat, Apr 17, 2010 at 10:10

Saving a ModelForm for the current user?

2010-04-17 Thread David Lindquist
Greetings, I am trying to solve what seems like an easy problem, but the solution eludes me even after many Google searches. I have a simple model: class Site(models.Model): user = models.ForeignKey(User) url = models.URLField() class Meta: unique_together = (('user',

Re: How to change the look of the main admin site page?

2010-04-17 Thread Caumons
Hello, thank you for answering so quickly. OK, so the page in fact is called admin index page. I fixed the problem I had with the apps I want to be shown in the page, thanks to permissions assigned depending on the user. Then, there is just one critical problem to solve with that. How can I

Re: how do you build an html website in python?

2010-04-17 Thread Richard Shebora
Check out this site. It will give you a great starting point for basic and some complex django apps... http://alpha.djangogenerator.com On Sat, Apr 17, 2010 at 8:39 PM, Nick Lacey wrote: > > > On Apr 17, 9:52 pm, Steven Elliott Jr wrote: > >>

Re: IF no longer short-circuits in 1.2?

2010-04-17 Thread Russell Keith-Magee
On Sun, Apr 18, 2010 at 8:53 AM, Jerry Stratton wrote: > It looks like {% if %} with OR or AND no longer short circuits under > 1.2-beta-1. > > class Page(models.Model): >        ... > >        def beTrue(self): >                print "BEING TRUE" >                return True >

IF no longer short-circuits in 1.2?

2010-04-17 Thread Jerry Stratton
It looks like {% if %} with OR or AND no longer short circuits under 1.2-beta-1. class Page(models.Model): ... def beTrue(self): print "BEING TRUE" return True def beFalse(self): print "BEING FALSE" return

Re: how do you build an html website in python?

2010-04-17 Thread Nick Lacey
On Apr 17, 9:52 pm, Steven Elliott Jr wrote: > then read the django book > > http://www.djangobook.com/ Thanks for this link ... I worked through the Django Project tutorial, but in all honesty did not find it very helpful. It's all very bitty, and unpicking the

Re: How to change the look of the main admin site page?

2010-04-17 Thread Ramiro Morales
On Sat, Apr 17, 2010 at 6:43 PM, Caumons wrote: > Hi everybody! > > Is there a way to change the appearance of the admin page after > loggin? I do not know the name of this page, but is the one where the > apps are listed and were the models of each app registered whith the >

How to change the look of the main admin site page?

2010-04-17 Thread Caumons
Hi everybody! Is there a way to change the appearance of the admin page after loggin? I do not know the name of this page, but is the one where the apps are listed and were the models of each app registered whith the admin appear. What I want is to do not show some apps in this page, for example

Re: How to delete objects whose id is stored in a session when it ends?

2010-04-17 Thread Caumons
Hello and thank you so much for answering my questions. As I told you to comment on my tests, here it is my explanation and solution. I installed django celery as Tom said, but it seems to be too complicated for my purpose, so I coded a python script which I execute periodically through cron

Re: Django-PostgreSQL-Unix_socket

2010-04-17 Thread ge...@aquarianhouse.com
leave HOST='' # empty then it's unix sockets On Apr 17, 10:04 pm, user4f <4fs...@gmail.com> wrote: > What exaple settings in settings.py for connection to PostgreSQL via > unix soket? > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To

RE: how do you build an html website in python?

2010-04-17 Thread Joe Goldthwaite
I'm not sure what your experience level is. If you're a beginning python/web developer it can be confusing. I'm going to assume that's the case. To others in the list, feel free to correct me if I get any of this wrong. I'm no expert. To build a web site you need to have a web server. Most

Re: how do you build an html website in python?

2010-04-17 Thread jay
Codecub, Actually his blog is a web application. Maybe this tutorials will help http://www.webmonkey.com/2010/02/Get_Started_With_Django/ It will show you how to create a small blog, which is exactly what that particular site is, just on a larger scale. It will also introduce you to some basic

Re: how do you build an html website in python?

2010-04-17 Thread Steven Elliott Jr
@codecub If you are interested in just building an HTML website why not just write it in HTML? Why do you think you need to use Python? What are the requirements of the website? Do you need a database and middleware? If so I would recommend following the django tutorial first:

Django-PostgreSQL-Unix_socket

2010-04-17 Thread user4f
What exaple settings in settings.py for connection to PostgreSQL via unix soket? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-17 Thread Steven Elliott Jr
I came from java (spring mostly) then asp.net then php, rails and finally to django. While django is my favorite I can still use all the others just fine. Don't box yourself in and become a zealot of any one language/framework. Learn many and keep exploring. It will only make you a better

Re: how do you build an html website in python?

2010-04-17 Thread Steven Elliott Jr
Python won't build a site for you by itself. Do you already know python, HTML, JavaScript, relational databases and the like? All of these things are still important. Python is only one piece of the overall puzzle. -Steven Elliott Jr On Apr 17, 2010, at 9:13 AM, "ge...@aquarianhouse.com"

|title filter selectively not functioning

2010-04-17 Thread Jason
Hey everyone-- This is driving me a little crazy. Here's my complete template code for the following page: http://www.rainbow.coop/products/sundries.html {% if sundries %} The following products are currently on sale in the

Re: how do you build an html website in python?

2010-04-17 Thread codecub
that's really unhelpful dude, i read through that and it doesnt even help at all thats for software/applications not websites -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To

caching querysets between requests

2010-04-17 Thread HARRY POTTRER
I have a page that needs to get a few values via the aggregate function of querysets. There are about 15 of them, and they all look like this: SELECT SUM(some_column_name) FROM ... and they each take a few hundred milliseconds each. That makes the page take a lot longer to render than I'd like.

Re: ChoiceField Being Unpatriotic

2010-04-17 Thread ge...@aquarianhouse.com
try with: class AddressForm(forms.Form): first_and_last_name = forms.CharField(128, 1) street1 = forms.CharField(128, 1) street2 = forms.CharField(128, 1) city = forms.CharField(64, 1) state = forms.ModelChoiceField(queryset=States.objects.all()) form =

Re: signals and "weak reference"

2010-04-17 Thread Masklinn
On 17 avr. 2010, at 16:37, anentropic wrote: in the docs there is this paragraph: "Note also that Django stores signal handlers as weak references by default, so if your handler is a local function, it may be garbage collected. To prevent this, pass weak=False when you call

ChoiceField Being Unpatriotic

2010-04-17 Thread amyhalf
Hi, all! For the life of me I can't get anything to show up in a drop-down. Here's the model: class States(models.Model): id = models.IntegerField(unique = True, primary_key = True) abbrev = models.CharField(max_length = 2, blank = False) long_form =

RE: Re: Plugin for Eclipse

2010-04-17 Thread Henrik Genssen
Seems not to work in Aptana 1.5.1.025914 I can install it, but it does not show up in the settings... any chance to get in working in Aptana, too? Hinnack -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

signals and "weak reference"

2010-04-17 Thread anentropic
in the docs there is this paragraph: "Note also that Django stores signal handlers as weak references by default, so if your handler is a local function, it may be garbage collected. To prevent this, pass weak=False when you call the signal’s connect()." Can someone please explain to me what it

Re: how do you build an html website in python?

2010-04-17 Thread Vasil Vangelovski
That website is built using django which is a web framework built in python. If you want info on how to build a website using django consult the django tutorial: http://docs.djangoproject.com/en/dev/intro/tutorial01/ and the docs: http://docs.djangoproject.com/en/dev/contents/, If you want to

Re: test with fk to user doesn´t fail (although it should)

2010-04-17 Thread patrickk
I see ... thanks for the explanation. patrick On Apr 17, 3:02 pm, Karen Tracey wrote: > On Sat, Apr 17, 2010 at 8:01 AM, patrickk wrote: > > haven´t done much testing yet, so this may be a trivial question. > > > here´s my testcase: > > class

Re: how do you build an html website in python?

2010-04-17 Thread ge...@aquarianhouse.com
http://www.djangoproject.com/ On Apr 17, 3:06 pm, codecub wrote: > i want to create a website like whalesalad.com and ive read through > the python documentation but it doesnt explain building a website out > of scratch in python > > -- > You received this message because

how do you build an html website in python?

2010-04-17 Thread codecub
i want to create a website like whalesalad.com and ive read through the python documentation but it doesnt explain building a website out of scratch in python -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: test with fk to user doesn´t fail (although it should)

2010-04-17 Thread Karen Tracey
On Sat, Apr 17, 2010 at 8:01 AM, patrickk wrote: > haven´t done much testing yet, so this may be a trivial question. > > here´s my testcase: > class CostAccountModelTests(TestCase): >def setUp(self): >self.account = CostAccount.objects.create(user_id=1) >

Re: file upload formset

2010-04-17 Thread Karen Tracey
On Sat, Apr 17, 2010 at 2:54 AM, Alfredo Alessandrini wrote: > profile.html > --- > > {{ formset }} > > > --- > > If I change 'course' or 'project' it's work. But if I try to upload a > file don't work. Any suggestion? > > First problem

test with fk to user doesn´t fail (although it shou ld)

2010-04-17 Thread patrickk
haven´t done much testing yet, so this may be a trivial question. here´s my testcase: class CostAccountModelTests(TestCase): def setUp(self): self.account = CostAccount.objects.create(user_id=1) def test_account_created(self): self.assertEqual(CostAccount.objects.count(),

Re: Giving up PHP. ...Can't decide between Django & Rails

2010-04-17 Thread Massimiliano della Rovere
Grok + zope3 could be a choice too. On Sat, Apr 17, 2010 at 05:39, hcarvalhoalves wrote: > Why do you have to "make a choice"? Learn both. They can be useful in > many different ways. > > I learned Rails (and Ruby) before Django, because I saw some material > for Ruby

Re: Authentication using email in Django 1.1

2010-04-17 Thread ge...@aquarianhouse.com
when overwrite the auth module :) On Apr 17, 12:08 pm, Marconi wrote: > Hello, I've been googling and I can't find a solution to use email > instead of username when logging-in that will work in Django 1.1 and > should also work on the admin side. > > -- > You received this

Authentication using email in Django 1.1

2010-04-17 Thread Marconi
Hello, I've been googling and I can't find a solution to use email instead of username when logging-in that will work in Django 1.1 and should also work on the admin side. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: a simple question concerning dots in template values

2010-04-17 Thread xpanta
Thank you very much. I found in the internet a custom tag that does the job. :-) On 16 Απρ, 00:15, Daniel Roseman wrote: > On Apr 15, 8:26 pm, xpanta wrote: > > > I have this template problem. > > > Although {{ myDictionary.1 }} works, if I write > >

Filter by ID using Gql

2010-04-17 Thread Jitesh
This query works well db.GqlQuery(Select * from mytable where __key__ IN :x", x=myarray) how can i filter by google's auto increment "id" i.e. I want to filter by id: db.GqlQuery(Select * from mytable where __id__ IN :x", x=myarray) This gives error Is there any other way so

Re: Non-conventional use of django templates.

2010-04-17 Thread Tomasz Zieliński
On 16 Kwi, 19:22, Paweł Roman wrote: > > Did anyone use a django template language in that fashion in a web > application that, itself is written in django? Does it make sense? Is > it safe? > I did, but it's been used by trusted set of users, so there were not that

file upload formset

2010-04-17 Thread Alfredo Alessandrini
Hi, I'm trying to upload a file by a formset. model.py: --- class Person(models.Model): user = models.ForeignKey(User) course = models.TextField(blank=True, null=True) project = models.TextField(blank=True, null=True) CV_ENG = models.FileField(upload_to='upload/CV/',