django filters

2010-05-19 Thread rahul jain
Hi, In my model, I have set up one filter which helps in filtering out the results on admin Panel. The way its works now that its displays the old objects first and then the most recent ones. Is it possible to make it other way around ?. Let me know. --RJ -- You received this message because

Re: Uploaded File Security

2010-05-19 Thread Lee Hinde
On Wed, May 19, 2010 at 7:19 PM, Mike Dewhirst wrote: > On 20/05/2010 11:00am, Lee Hinde wrote: > >> I'm working on an intranet app for a client that will have file uploads. >> I'm early in the process, but have the uploading working just fine via >> admin. >> >> Once we

Re: How to insert a search form inside Django?

2010-05-19 Thread ravi krishna
Thanks really..that was helpful :) On Wed, May 19, 2010 at 6:43 PM, bx2 wrote: > I'm suggesting to use one of signal-based approches as explained at > DjangoCon presentation by co-author of Satchmo. > Here is the link with examples of source code: >

Problems with url encoding

2010-05-19 Thread Caumons
Hi everybody. I am having problems with the urlencoding. I explain. In a template I have the following code: Return to list In the view I pass the variables slug_platform and num_pag to the template, but the problem is that when I click the link it brings me to the following page (copy/paste

Re: Uploaded File Security

2010-05-19 Thread Mike Dewhirst
On 20/05/2010 11:00am, Lee Hinde wrote: I'm working on an intranet app for a client that will have file uploads. I'm early in the process, but have the uploading working just fine via admin. Once we get to deployment, I'm unclear on how to coordinate the security that django will know about

Uploaded File Security

2010-05-19 Thread Lee Hinde
I'm working on an intranet app for a client that will have file uploads. I'm early in the process, but have the uploading working just fine via admin. Once we get to deployment, I'm unclear on how to coordinate the security that django will know about (group X has access to X's files, but not

Re: If is first time logging in

2010-05-19 Thread Nick
I am, but I'm not opposed to custmizing one. This part of the project will undoubtedly get bundled as a reusable registratioon and login app for other projects so it doing what I'd like it to do is more important than convenience. On May 19, 5:23 pm, Dejan Noveski wrote: > Do

Output data across models in XML

2010-05-19 Thread Andrew
I'm trying to make a webservice that outputs XML representation of data from a model. The model itself looks roughly like this: - class Product(models.Model): short_description=models.CharField(max_length=300) long_description=models.CharField(max_length=2000)

Django for desktop application

2010-05-19 Thread Ahmed Salem
Hi all I'm search for python tool help my in Quran search program for NLP & python now i found dijango but i ask about can it conected with jython and perform desktop app Please advice or send me link if it can do that Thanks a lot -- You received this message because you are subscribed to

custom css class on all form fields

2010-05-19 Thread andreas schmid
hi, is it possible to programmatically add a custom css class to each label and field in a djangoform? i know i can add a class to a specific widget with attrs={} but i need such a class on all labels and fields for many forms. im using django newforms on appengine with its default version ...

group password

2010-05-19 Thread Junkie Dolphin
Hello everybody, I am coding a django app for performing an online, anonymous experiment system. The idea is that we give a login code to a group of participants (e.g. students at our university) and tell them a specific time window (usually a couple of hours) during which they can login to the

Re: template_context_processors

2010-05-19 Thread stefan
Hi, I have this issue too :) On May 17, 1:00 pm, stefan wrote: > Hello, > > I have this issue, I am using the development Django version (checked > out from svn). I use a template_context_processor and sometimes the > context_processor is processedtwice, > one for the

Re: If is first time logging in

2010-05-19 Thread Dejan Noveski
Do you use the generic login view? On Thu, May 20, 2010 at 12:16 AM, Nick wrote: > I have an expanded user form right now. Here is the sign up process. > > user registers using username, email, password > > It sends and activation link to that email. > > User clicks on the

Re: If is first time logging in

2010-05-19 Thread Nick
I have an expanded user form right now. Here is the sign up process. user registers using username, email, password It sends and activation link to that email. User clicks on the link and they are activated User logs in Here is where I would like the extended profile to pop up the first time.

Re: If is first time logging in

2010-05-19 Thread Dejan Noveski
Best will be if you make Useraccount model that will inherit from User, add field formsets_passed = BooleanField(initial = False) The reason why i think this is better idea is, user might leave the page before finishing the aditional forms. That way, next time it will be second login and you will

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread Bill Freeman
You could put a method on your basket object which calculates the shipping. Then if the basket object is included in the context, you can trivially call it. Or perhaps better, fix up you all_purchases iterable to append it. Something like: def add_shipping(purchaces_iterable): for i, p

If is first time logging in

2010-05-19 Thread Nick
I'm trying to figure out a way to see if it is a users first time logging in after registering on the site. If it is then I will pass them through some formsets, otherwise I let them go to their profile page. I tried using date_joined == last_login but that doesn't work, as the last login date

Re: trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread shofty
apologies, i tab spaced before id finished. the if forloop.last is waiting til its written out all fo the html for the items then i was going to add a final item which was shipping to the basket. but cant really do that without doing math in the template. would like to know if anyone knows of a

trying not to do any operations in template, but not sure i can avoid it.

2010-05-19 Thread shofty
not sure if i've totally missed the point of the correct way to do this. because i couldn't get the django-cart project to do what i wanted (and more because there is a note on the page explaining its got bugs and that i should have been able to fix them but not detailing said bugs) i decided to

Re: manager.raw returning Capitalized field names

2010-05-19 Thread geraldcor
Russ, >As for templates - they don't ever use the CamelCase name. They >exclusively use the model names, and there's no 'raw query' equivalent >for templates. This is the problem that is presenting the possible bug. I have to use {{ m.SomeField }} in my template rather than {{ m.somefield }} as

Re: List of Users online

2010-05-19 Thread Brian Neal
On May 19, 12:31 pm, EmileZola wrote: > I want to list the logged in users on my index page and was wondering > what was the right way to do this. > > Can I do it similar to this ? > def index(request): >     return render_to_response('index.html', { >         'online_users':

Re: File/Folder permissions for deploying Django app

2010-05-19 Thread Shawn Milochik
To some extent it doesn't matter. Just make sure your code is as secure as any private information you wouldn't want others to have access to. When Django is running in a production environment, there is a Python instance listening on a port on your system. Your Web server (Apache, nginx,

List of Users online

2010-05-19 Thread EmileZola
I want to list the logged in users on my index page and was wondering what was the right way to do this. Can I do it similar to this ? def index(request): return render_to_response('index.html', { 'online_users': User.objects.filter(last_login > delay) }) delay being "now - 15

Re: Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread steve
That was it, Tom, thanks On May 19, 9:43 am, Tom Evans wrote: > On Wed, May 19, 2010 at 5:37 PM, pyfreak wrote: > > I was on this page, but I went directly to the "1.1" link in that > > first sentence because I am using 1.1 actually > > > This

Re: Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread Iván Raskovsky
On Wed, May 19, 2010 at 1:23 PM, pyfreak wrote: > I tried placing my form in the template like {{ f['subject'] }} and I > get TemplateSyntaxError. Of course using my own form and existing > fields > Another important point is how to display the contents for a key in a

Re: Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread Daniel Roseman
On May 19, 5:37 pm, pyfreak wrote: > I was on this page, but I went directly to the "1.1" link in that > first sentence because I am using 1.1 actually > > This page is for the development version. > > Thanks though. > I don't know why you think that makes any difference

Form Field and Form instance

2010-05-19 Thread Dejan Noveski
Hi all, Is there any way to get the form object in a field class? Something similar to contribute_to_class in model forms? Thanks -- -- Dejan Noveski Web Developer dr.m...@gmail.com Twitter: http://twitter.com/dekomote | LinkedIn: http://mk.linkedin.com/in/dejannoveski -- You received this

Re: Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread Tom Evans
On Wed, May 19, 2010 at 5:37 PM, pyfreak wrote: > I was on this page, but I went directly to the "1.1" link in that > first sentence because I am using 1.1 actually > > This page is for the development version. > > Thanks though. > The same information is in the 1.1

Re: insert html in html

2010-05-19 Thread CrabbyPete
Brian, Thanks. The safe filter worked for me. I was writing it to a file and then doing an {% include calendar %}, but your solution worked out. On May 18, 7:00 pm, Brian Neal wrote: > On May 18, 2:00 pm,CrabbyPete wrote: > > > I want to insert a html

Re: Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread pyfreak
I was on this page, but I went directly to the "1.1" link in that first sentence because I am using 1.1 actually This page is for the development version. Thanks though. On May 19, 9:29 am, Nuno Maltez wrote: > I think you need the google search help list :-) > > Just

Re: Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread Nuno Maltez
I think you need the google search help list :-) Just type "django forms" in the search box at docs.djangoproject.com And in the first result you have a lot of examples on how to print everything from a form in your template: http://docs.djangoproject.com/en/dev/topics/forms/ On Wed, May 19,

Extremely simple question that I can't get a simple answer for in Docs

2010-05-19 Thread pyfreak
Frustratingly enough, docs.djangoproject.com tells you how to print out the HMTL for a single field in your form, but it uses a shell to demonstrate it: f = ContactForm() >>> print f['subject'] >>> print f['message'] However, I need to know how to do this in a template I tried placing my

Template tags variables cannot be None, False, True?

2010-05-19 Thread Peter Coles
Do tags not support the literals None, False, or True? Why would numbers and strings be supported, but not these? It is possible to pass these as variables into the context (even in a context processor) as {'None': None, 'True': True, 'False': False} and it's possible that someone may be using

Re: Django Sphinx Foreign key search

2010-05-19 Thread yafeng wu
Hi, I got the same problem when building my website. Have you solved it? Please let me know. Thanks, On Apr 13, 4:04 am, urukay wrote: > Hi, > > I'm trying to create full text search on model, everything goes fine > when > searching TextFields but I have a problem with

Re: send_mail not firing

2010-05-19 Thread Nick
Welp, indentation error: def save(self): needed to unindent so it was called when the form was process, instead it was waiting for an error to trigger it, which it wouldn't do because the error halts the form from processing. There goes 13 hours of my life I'm never getting back. On May 19,

Re: send_mail not firing

2010-05-19 Thread Nick
It looks like the problem isn't with send_mail, its the save override on the form, the is_active = False isn't setting that option in the DB either, so it is skipping over the save options. Here they are again: forms.py: class RegisterForm(UserCreationForm): email =

Re: Is it possible to add a table on my database with a django code ?

2010-05-19 Thread Pep
:) Thanks for your answers. Effectively, I won't do this but I was curious on manipulate a database like this. However it could be useful in a few project with a limited number of users. On 19 mai, 14:35, Dj Gilcrease wrote: > On Wed, May 19, 2010 at 8:18 AM, Pep

Re: Turn off SQL Collection but leave DEBUG on

2010-05-19 Thread Karen Tracey
On Wed, May 19, 2010 at 9:10 AM, Kenneth Loafman wrote: > The subject says it all, how do you turn off the SQL logging to memory > but leave DEBUG on? I need to test a daemon mode Django process in > DEBUG mode, but the SQL collection in DEBUG makes it appear that

gourav arora wants to chat

2010-05-19 Thread gourav arora
I've been using Google Talk and thought you might like to try it out. We can use it to call each other for free over the internet. Here's an invitation to download Google Talk. Give it a try! --- gourav arora wants to stay in

gourav arora wants to chat

2010-05-19 Thread gourav arora
I've been using Google Talk and thought you might like to try it out. We can use it to call each other for free over the internet. Here's an invitation to download Google Talk. Give it a try! --- gourav arora wants to stay in

Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Daniel Hilton
On 19 May 2010 14:51, Dexter wrote: > Hi thanks for your replies, > I couldn't run the django page on a different server, because I only have > one VPS running. > But I understand there isn't a way to catch "events" on a database update. > Grtz, Dexter If you wrote a

user registration extras

2010-05-19 Thread appel268576
hi there. I am having some issues and don't really know where to go to with this. I am using the django-registration from bitbucket which is very handy, however I would like to pass extra items upon registration such as 'first name', 'last name' etc. any ideas? -- You received this message

Re: contrib.auth test failures persist to 1.2

2010-05-19 Thread Karen Tracey
2010/5/19 Filip Gruszczyński > I have just installed Django 1.2 hoping, that my test suites will > finally work flawlessly and I won't have to watch tests from > django.contrib.auth fail. But, here they are again. Does anyone have > any idea, how I can get rid of those? I

Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Dexter
Hi thanks for your replies, I couldn't run the django page on a different server, because I only have one VPS running. But I understand there isn't a way to catch "events" on a database update. Grtz, Dexter On Wed, May 19, 2010 at 3:43 PM, Daniel Hilton wrote: > On 19

Re: Can you give me explanation for my

2010-05-19 Thread gourav arora
On Wed, May 19, 2010 at 6:25 AM, derek wrote: > On May 18, 10:38 pm, Hendra Kurniawan > wrote: > > Hi all, > > Can you give me a bright explanation for Django Framework ? how can > > Django being configure in cloud computing? it's support? can

Re: What architecture do you use for media?

2010-05-19 Thread Michel Thadeu Sabchuk
Hi Andy, I do not use a different server for media yet but it is in project. Maybe I could help: > 2. Do you typically use a different hosting company for the media > server than you do for the django server? If so, can you suggest any > names? There is the Amazon S3 and Rackspace Cloudfiles

Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Daniel Hilton
On 19 May 2010 00:02, Dexter wrote: > Hi, > I want to sync emailadresses in the django.contrib.auth User model, to a > sympa mailinglist subscriberlist. > I really don't have any experience with sympa. So I don't know how this > process usually goes, > but what I did found

Re: Creating a new model field that includes two or more existing model fields (ie. xsd's complex type equivalent)

2010-05-19 Thread Marc
I have just come up myself with an easy way to implement it: Inheriting from a model class that includes these fields. However I don't like it at all aesthetically. Do I really have to do it like this? On May 19, 3:26 pm, Marc wrote: > Hi all, > I would like to make my code

Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Tom Evans
On Wed, May 19, 2010 at 12:44 PM, Dexter wrote: > Hi, > I'm just trying to run a mailinglist now, but when I set alias_manager in > sympa.conf, I get the following error: > unknown field: alias_manager in sympa.conf > How should I set my alias_manager? > Grtz, Dexter sympa

Creating a new model field that includes two or more existing model fields (ie. xsd's complex type equivalent)

2010-05-19 Thread Marc
Hi all, I would like to make my code more compact and DRY, and for that purpose I need to create a new field that includes two or more existing models fields (eg. a CharField, a DateField). Is there anything easier than inheriting from both classes and following

Re: Can you give me explanation for my

2010-05-19 Thread derek
On May 18, 10:38 pm, Hendra Kurniawan wrote: > Hi all, > Can you give me a bright explanation for Django Framework ? how can > Django being configure in cloud computing? it's support? can you give > me some link article for this ? > > Thanks Before that.. > >

reverse('django.contrib.auth.views.login') in auth tests returns /login/ rather then value set in LOGIN_URL

2010-05-19 Thread Filip Gruszczyński
In my settings I have set: LOGIN_URL = '/accounts/login/' Now if I run ./manage shell and type: In [3]: reverse('django.contrib.auth.views.login') Out[3]: '/accounts/login/' which is ok. However, when I run one of the tests from django.contrib.auth: def

Re: ModelForm always calls Model's clean method

2010-05-19 Thread Karen Tracey
On Wed, May 19, 2010 at 1:12 AM, ak37 wrote: > I just tried the new Model Validation feature in Django 1.2 and I > found out that ModelForm always calls the Model's clean method even > when the form validation has errors. This causes problems when the > model has a

Re: How to insert a search form inside Django?

2010-05-19 Thread bx2
I'm suggesting to use one of signal-based approches as explained at DjangoCon presentation by co-author of Satchmo. Here is the link with examples of source code: http://www.slideshare.net/ecomsmith/custom-signals-for-uncoupled-design. Furthermore you can look at DjangoBook here:

Re: Form validation

2010-05-19 Thread Dejan Noveski
> > >user = User.objects.get(pk=request.user.id) from = UpdateUserForm(user, ...initialstuff...) > First off, change this to form = UpdateUserForm(request.user,...) request.user is django.contrib.auth.User object. You have to have -- -- Dejan Noveski Web Developer dr.m...@gmail.com

Re: Form validation

2010-05-19 Thread Dejan Noveski
On Wed, May 19, 2010 at 3:11 PM, Dejan Noveski wrote: > >>user = User.objects.get(pk=request.user.id) > >from = UpdateUserForm(user, ...initialstuff...) >> > > First off, change this to form = UpdateUserForm(request.user,...) > request.user is django.contrib.auth.User

Turn off SQL Collection but leave DEBUG on

2010-05-19 Thread Kenneth Loafman
Hi, The subject says it all, how do you turn off the SQL logging to memory but leave DEBUG on? I need to test a daemon mode Django process in DEBUG mode, but the SQL collection in DEBUG makes it appear that there is a memory leak. ...Thanks, ...Ken -- You received this message because you are

Re: DKIM Email

2010-05-19 Thread Mark
On Apr 22, 4:16 am, Simon Meers wrote: > For anyone else who learned about DKIM recently [1], I've uploaded a > snippet for a DKIM-signing email backend [2]. Brilliant. I'm just developing a Django app, had read the CH article and was just about to figure out how to apply it

Re: Is it possible to add a table on my database with a django code ?

2010-05-19 Thread Dj Gilcrease
On Wed, May 19, 2010 at 8:18 AM, Pep wrote: > Hi everybody ! > > I would like to know if it's possible to add automatically a table on > my database when, for example, a new member subscribe on my website ? > > I mean, if I would like to do it manually, I'll have to change

Re: Is it possible to add a table on my database with a django code ?

2010-05-19 Thread Daniel Roseman
On May 19, 1:18 pm, Pep wrote: > Hi everybody ! > > I would like to know if it's possible to add automatically a table on > my database when, for example, a new member subscribe on my website ? > > I mean, if I would like to do it manually, I'll have to change my > Model

Is it possible to add a table on my database with a django code ?

2010-05-19 Thread Pep
Hi everybody ! I would like to know if it's possible to add automatically a table on my database when, for example, a new member subscribe on my website ? I mean, if I would like to do it manually, I'll have to change my Model and then to do manage.py syncdb. And that's all. But automatically

Form validation

2010-05-19 Thread derape
Hey there, i've got a problem with the form validation. I have a form where I need the currently logged in user, to check some stuff. So I did this in the form: def __init__(self, user, *args, **kwargs): self.user = user super(UpdateUserForm, self).__init__(*args, **kwargs)

DjangoPluggableApp - A ReusableApp implementation

2010-05-19 Thread Gaël Pasgrimaud
Hi, I saw some efforts to make django apps reusable[1] but nothing really complete and documented. I've released DjangoPluggableApp so: - developers can easily create and distribute a setuptools ready application with a simple command[2] - end users can install and configure an application

What architecture do you use for media?

2010-05-19 Thread Andy Kelley
I'm doing the first website where I need it to scale and want to host the media on a different server than the one with the django code. I'm going to have a lot of users uploading files ranging in 10 KB to 20 MB in size. I estimate that the average user will upload 20 MB per week. I have several

Re: css files are not loading properly for admin screens

2010-05-19 Thread Oulom Souvannavong
It is right It is needed to have more information to help you. Give some logs trace : when you lunch your ./runserver.sh : - what are the HTTP Request logs when your browser try to find the CSS files. - what are your settings concerning the HTTP access at your unix directory [ HTTP server

Re: Sync user objects with sympa mailinglist

2010-05-19 Thread Dexter
Hi, I'm just trying to run a mailinglist now, but when I set alias_manager in sympa.conf, I get the following error: unknown field: alias_manager in sympa.conf How should I set my alias_manager? Grtz, Dexter On Wed, May 19, 2010 at 1:02 AM, Dexter wrote: > Hi, > > I

Re: Proxy models and object instantiation

2010-05-19 Thread janedenone
I found the (obvious) solution: def __init__(self, *args, **kwargs): super(Page, self).__init__(*args, **kwargs) subclasses = { 'blog' : BlogPage, 'log' : LogPage, 'index' : Page,

Re: How create M2M through with out PK?

2010-05-19 Thread David De La Harpe Golden
On 19/05/10 10:42, Daniel Roseman wrote: How remove PK from table "libs_content_has_people" and don't use it? You can't. Why would you want to? Well, the natural primary key for a M2M table is quite typically composite and django's ORM just doesn't support composite primary keys right

Re: Ordering a QuerySet by a Python property ?

2010-05-19 Thread Thomas Guettler
thierry wrote: > Hi all, > > The order_by method makes possible to sort objects relatively to a > specified field. But how can I sort a QuerySet relatively to a Python > property ? order_by happens in the database. If you want to sort with python you can use sorted():

contrib.auth test failures persist to 1.2

2010-05-19 Thread Filip Gruszczyński
I have just installed Django 1.2 hoping, that my test suites will finally work flawlessly and I won't have to watch tests from django.contrib.auth fail. But, here they are again. Does anyone have any idea, how I can get rid of those? I would really like to see no errors, because this way we could

problem with admin tools 2.0 when dashboard.columns > 2

2010-05-19 Thread Massimiliano della Rovere
When I set Dashboard.columns to a value greater than 2, custom dashboardmodules are rendered narrower than they should appear and with lots of icons superimpressed. I am adding 1 DashboardModule and 2 LinkListDashboardModule-s to the CustomIndexDashboard using init_with_context. class

Re: How to insert a tuple into ManyToMany Relations

2010-05-19 Thread Daniel Roseman
On May 19, 5:03 am, Daemoneye wrote: > > class People(forms.Form): > HoldComments=models.ManyToManyField('Comment') > class Comment(forms.Form): > CommentWord=models.CharField(max_length=1) > > I've had these two tables, I'd want the people

Re: How create M2M through with out PK?

2010-05-19 Thread Daniel Roseman
On May 19, 6:06 am, "poison...@gmail.com" wrote: > Models: > > from django.db import models > > class People(models.Model): >         name = models.CharField(max_length=30) > >         class Meta: >                 db_table = 'libs_peoples' > > class Content(models.Model): >  

Re: send_mail not firing

2010-05-19 Thread Nuno Maltez
Anything it the mail server's logs? Any trace of your app trying to send the message? Any errors? Nuno On Tue, May 18, 2010 at 11:42 PM, Nick wrote: > Actually, I've fixed the problem with send_activation. If i go via the > form it still doesn't trigger the email. > > On May

Re: css files are not loading properly for admin screens

2010-05-19 Thread Sam Lai
Your Django instance isn't set up properly to serve media. Have you configured your web server (Apache, nginx, Cherokee etc.) to serve media? If so, what URLs are they mapped to? You need to set that into the MEDIA_URL variable, e.g. /media/. What you have now doesn't look right. MEDIA_ROOT tells

Re: One to One chat like Facebook?

2010-05-19 Thread Anand Agarwal
Hi Ivan Thanks for the details, I will try out hotdot and let you know my feedback. Regards Anand Got an Idea? BootStrap it Today!! On Mon, May 17, 2010 at 8:33 PM, Ivan Uemlianin wrote: > Dear Anand > > Frederico Caceres' app [1,2] is worth a

Ordering a QuerySet by a Python property ?

2010-05-19 Thread thierry
Hi all, The order_by method makes possible to sort objects relatively to a specified field. But how can I sort a QuerySet relatively to a Python property ? Thanks, Thierry. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

How to insert a search form inside Django?

2010-05-19 Thread ravi krishna
Hi, I want to include a search button inside my Django, which retrieves data from some google API or Wikimapia API, But i am stuck with adding a search option inside Django. i am a beginner with Django and Python programming. Can somebody please help me with this. -- Regards, Rav! -- You