avoid pre filled registration form

2010-02-23 Thread andreas schmid
hi, im using django registration to allow people to register to my site. the ugly thing is that the registration form is pre filled by the browser in a wrong way. the form has the usual 4 fields (username, email, pwd1 and pwd2) the prefilled fields are email with the username (wich is really bad)

Re: Need help in serialization of objects.

2010-02-23 Thread Oliver Beattie
I'm not entirely sure why you'd want to do this, but I'm sure you have your reasons. Probably the best way would be to write your own serializer, which subclasses Django's XML serializer (in django.core.serializers.xml_serializer), and overrides the start_serialization and end_serialization methods

Re: Adding a new language to Django?

2010-02-23 Thread derek
Thanks Daniel - I missed that part {sound of head slap}. Assuming I manage to do a translation, would there be any interest from the dev team to include this new language version? On Feb 23, 6:34 pm, Daniel Roseman wrote: > On Feb 23, 2:31 pm, derek wrote: > > > Unfortunately not; this only dea

Need help in serialization of objects.

2010-02-23 Thread chiranjeevi muttoju
Hi all, I want to convert the model object to xml data. i used the django serialization for that. then i'm getting the xml data as shown in bellow. But my aim to remove the "" tag or replacing that tag by other name. is there is any way to achieve that one. If anybody know please help me.

Re: Job opportunity - Newcastle, NSW, Australia

2010-02-23 Thread Sam Walters
Hi Peter If you want someone who is very good at python/django you could also try contacting the people here: http://www.newcastlelug.org/wiki/doku.php cheer sam_w On Mon, Feb 22, 2010 at 4:15 PM, Peter wrote: > Hi all > > Please see: > > http://tinyurl.com/djangojob > > for a job being adve

Re: From v1.2, url templatetag can not use both comma and space

2010-02-23 Thread Karen Tracey
On Tue, Feb 23, 2010 at 10:38 PM, Hyungyong Kim wrote: > Dear django-users, > > I updated latest development version (r12508) and some test failed. > It seems that url templatetag syntax modified. You can not use both > comma and space together for seperator of arguments > > For example, > > {% u

From v1.2, url templatetag can not use both comma and space

2010-02-23 Thread Hyungyong Kim
Dear django-users, I updated latest development version (r12508) and some test failed. It seems that url templatetag syntax modified. You can not use both comma and space together for seperator of arguments For example, {% url url_name arg1,arg2 %} --> OK {% url url_name arg1 arg2 %} --> OK {% u

Django Template Mode for Panic Coda and SubEthaEdit

2010-02-23 Thread jbergantine
For anyone else that combines Django with Coda, I've created a mode for the Django Template language. You can preview it and get more info from http://joebergantine.com/werkstatt/djangotemplate. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: custom method in view/models

2010-02-23 Thread Timothy Kinney
Can you show me how you got it to work? I'd like to learn from this as well. Cheers. -Tim On Tue, Feb 23, 2010 at 8:39 PM, soFh wrote: > Well its done finaly. > i was doing mistake , i was going for a loop on ASt model , while i > must goto Rates and its working perfect now . > > > On Feb 24,

Re: custom method in view/models

2010-02-23 Thread soFh
Well its done finaly. i was doing mistake , i was going for a loop on ASt model , while i must goto Rates and its working perfect now . On Feb 24, 5:19 am, soFh wrote: > no this function is working fine.here i am just converting seconds > into minutes and rounding it to , thts we call 60/60 bill

Re: custom method in view/models

2010-02-23 Thread soFh
no this function is working fine.here i am just converting seconds into minutes and rounding it to , thts we call 60/60 billing, say if user has called for 4 minutes and 1 sec then it would round up it like 5:00 rather then showing 4:01 and its exactly showing the same. I got my mistake and now jus

Re: Scripting Import of CSV data?

2010-02-23 Thread Vasil Vangelovski
Write a management command that downloads the CSV from email and loads it in your database. Set up a cron job that calls the management command. This is how I would do it. There may be some unnecessary complication with that approach, like figuring out which emails contain the CSVs of interest etc

Re: Fascism is coming to Internet

2010-02-23 Thread Russell Keith-Magee
On Tue, Feb 23, 2010 at 10:11 PM, Joan Miller wrote: > *Sorry by this off topic message, but this is too important* I'm sure you're deeply concerned by this issue. For the record, I am too. However, everyone thinks that their pet issue is more important than the rules. Allow me to assure you that

Re: custom method in view/models

2010-02-23 Thread Timothy Kinney
Ok, I think I understand what is going wrong. Look at your minutes function (from dpaste above in the thread): def minutes(self): if self.billsec > 0 and self.disposition=='ANSWERED': x = self.billsec/60.0 if type(x) == float

Scripting Import of CSV data?

2010-02-23 Thread Victor Hooi
heya, I have a Django app that will need to grab CSV data being sent to an email address into it's own database. I'm assuming if I can get IMAP access to the mailbox, I can just script all of that part in Python. However, what's the best way of scheduling the process, so that it'll regularly chec

Re: Optimizing template rendering and database queries

2010-02-23 Thread Andy McKay
> I would like to include the following values on my admin pages, as > part of the base_site: > time_to_query_database > time_to_render_page django-debug-toolbar has all that and more -- Andy McKay, @clearwind http://clearwind.ca/djangoski -- You received this message because you are subscri

Re: does current aggregation api support counting by month?

2010-02-23 Thread Russell Keith-Magee
On Wed, Feb 24, 2010 at 1:01 AM, Manolis wrote: > Hello, > I have a model like this: > class Report(models.Model): >    date_submitted = models.DateTimeField() > > I want to calculate some aggregate counts per month. The SQL query for > this would be: > SELECT YEAR(date_submitted), MONTH(date_subm

Re: custom method in view/models

2010-02-23 Thread soFh
Hi Tim Sure id caller id dialed Number Call Duration Call Cost Call Date Dest Channel Application {% for call in calls %} {{ call.id }} {{ call.src }} {{ call.dst }}

Optimizing template rendering and database queries

2010-02-23 Thread Timothy Kinney
I would like to include the following values on my admin pages, as part of the base_site: time_to_query_database time_to_render_page Is there code I can draw from to accomplish this? Or do I need to code it myself? Are there built-in methods in Django for timing database queries to help users opt

Re: custom method in view/models

2010-02-23 Thread Timothy Kinney
It would help if I could see the template you were using so I could see how the fields were being filled. Can you paste it? -Tim On Tue, Feb 23, 2010 at 5:04 PM, soFh wrote: > For More , > Please visit this snap shot of my template view : > > http://173.45.115.106/template.jpg > > This will pr

Re: Deciding how to start building a search form

2010-02-23 Thread Nick
Thanks adam, that was the direction I was looking for. On Feb 23, 4:57 pm, Andy McKay wrote: > On 2010-02-23, at 12:50 PM, Nick wrote: > > > Anyways, what I'm wondering is, should I build this up by hand or > > should I use something like haystack?  I am only querying against a DB > > and not en

Re: custom method in view/models

2010-02-23 Thread soFh
For More , Please visit this snap shot of my template view : http://173.45.115.106/template.jpg This will probably clear me , that what i want in my column "call Cost" in my datatable. thanks On Feb 24, 2:47 am, Timothy Kinney wrote: > It sounds like you should have a look > at:http://docs.d

Re: Deciding how to start building a search form

2010-02-23 Thread Andy McKay
On 2010-02-23, at 12:50 PM, Nick wrote: > Anyways, what I'm wondering is, should I build this up by hand or > should I use something like haystack? I am only querying against a DB > and not en entire site. Doing a search on one model is pretty straightforward. If however you need to do full tex

Re: custom method in view/models

2010-02-23 Thread soFh
Thanks tim for being with me. MY template is working absolutely fine. but its showing me data of my cdr_table thats is simple first model. thats fine , but i need one more "custom" column in my html table showing cost of call cause in my model AST there is only duration of call . to get cost i made

Re: custom method in view/models

2010-02-23 Thread Timothy Kinney
It sounds like you should have a look at: http://docs.djangoproject.com/en/dev/ref/templates/ Instead of rendering straight to html you can structure the html as a template and then feed your dictionary context in. Then your view points to the template. If your template was called test.html then i

Re: custom method in view/models

2010-02-23 Thread soFh
my prefix could be changed and hence its length too , so let me show you what i did to get the price from Rates table against prefix used in Ast.dst from cdr.cdrs.models import Ast,Rates price=0 for i in Ast.objects.all(): for x in Rates.objects.all(): l = len(x.prefix)

Re: custom method in view/models

2010-02-23 Thread Timothy Kinney
I agree, your models are correct. You just need to create a view (possibly using a template) to serve this information to the web. -Tim On Tue, Feb 23, 2010 at 4:16 PM, Daniel Roseman wrote: > On Feb 23, 9:10 pm, soFh wrote: > > Well i was already thinking that i am not so clear in my questio

Re: Generate random data for Django models

2010-02-23 Thread Timothy Kinney
After a bunch of trial and error, basically, I've decided not to put the url pattern in the ProvinceAdmin class. It is easier and makes more sense (to me) to add the urls to myproject/urls.py and then create a file called myproject/myapp/admin_views.py with the custom admin views. It's probably pos

Re: Problem with defer

2010-02-23 Thread Dexter
Aah.. TY On Tue, Feb 23, 2010 at 9:46 PM, Daniel Roseman wrote: > > On Feb 23, 8:25 pm, Dexter wrote: > > I want to stringify that objectList with only the name field in the > result. > > How can I achieve this? > > Floor.objects.all().values_list("name", flat=True) > > -- > DR. > > -- > You rec

Re: custom method in view/models

2010-02-23 Thread Daniel Roseman
On Feb 23, 9:10 pm, soFh wrote: > Well i was already  thinking that i am not so clear in my question. > so better let me post my model and what i want here . > > http://dpaste.com/163776/ > > sorry I missed by mistake "C" of class Rates while pasting it on > dpaste. > > Anyways there are two model

Re: Looking for a wiki or cms created with django

2010-02-23 Thread piz...@gmail.com
First google result for "django cms": http://www.django-cms.org/ Hope this is what you need :) El 23/02/2010, a las 22:53, Adrian Maier escribió: Hello all, I am looking for a solution for creating a website that : - is a presentation for a company - the contents is editable in wiki-style -

Looking for a wiki or cms created with django

2010-02-23 Thread Adrian Maier
Hello all, I am looking for a solution for creating a website that : - is a presentation for a company - the contents is editable in wiki-style - allows full control over the template used by each page - has search capabilities - is preferably implemented with django So I am basically looking for

lazy imports for cyclic imports prevention

2010-02-23 Thread Itay Donenhirsch
Hi folks, in order to prevent cyclic import problems i've written this class: class lazy_import: def __init__(self, module, method = None ): if method: self.module = module self.method = method else: tokens = module.split('.')

Re: custom method in view/models

2010-02-23 Thread soFh
Well i was already thinking that i am not so clear in my question. so better let me post my model and what i want here . http://dpaste.com/163776/ sorry I missed by mistake "C" of class Rates while pasting it on dpaste. Anyways there are two models. there is one field billsec in model named "As

Re: two different models, order by date

2010-02-23 Thread Nick
In the view set up something like all = [Books.objects.all() & Movies.objects.all()].orderby('date') On Feb 23, 2:22 pm, ds wrote: > Hello group, > > i have a simple question here, i've been trying to found the answer > but somehow i got confused if this is wheter possible or not: > > I have two

Deciding how to start building a search form

2010-02-23 Thread Nick
I have seen many messages about this but I am at a loss for what to do. Currently I am building a DB of state representatives. This DB has to other tables besides that of the actual representative. Those tables are for committees those members are part off. I use manytomany and foreign key relat

Re: Problem with defer

2010-02-23 Thread Daniel Roseman
On Feb 23, 8:25 pm, Dexter wrote: > I want to stringify that objectList with only the name field in the result. > How can I achieve this? Floor.objects.all().values_list("name", flat=True) -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Problem with defer

2010-02-23 Thread Dexter
I want to stringify that objectList with only the name field in the result. How can I achieve this? On Tue, Feb 23, 2010 at 8:00 PM, Bill Freeman wrote: > How do you know they weren't deferred? You can still access them if they > were, IIUC. It just causes additional queries, behind the scenes

two different models, order by date

2010-02-23 Thread ds
Hello group, i have a simple question here, i've been trying to found the answer but somehow i got confused if this is wheter possible or not: I have two django models, movies and books , i want to get all the objects from both models and order them by date, getting result_set that might look lik

Re: Problem with views and urls

2010-02-23 Thread piz...@gmail.com
Thanks Karen and schms, adding $ at the end worked fine. I'm still new to django and I'm a bit lost hehe. -- 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 t

Re: custom method in view/models

2010-02-23 Thread Timothy Kinney
Sorry, I'm having trouble understanding exactly what you want. Could you be more specific about your models and your calculations? Let me take a stab at a guess, though. Let's say you have a model City with a population field and a model WaterUse with a total_water_use field. Then let's say you wa

Re: Problem with views and urls

2010-02-23 Thread Jon Loeliger
> Hello, > > I'm having a problem with views and url's. If I have a url called > "people" that has a callback to "index" works fine, but if I add a > url for parameters, let's say "people//" it does call the > index function, instead of the defined one. If I change it, for > example to "pp

Re: order_by a quotient?

2010-02-23 Thread Timothy Kinney
Sorry, I just thought of something else. You could add a field to the database that contains the calculated quotient and then order by that column. -Tim On Tue, Feb 23, 2010 at 1:50 PM, Timothy Kinney wrote: > I think I would write a custom function to do this, but there may be a good > reason

Re: order_by a quotient?

2010-02-23 Thread Timothy Kinney
I think I would write a custom function to do this, but there may be a good reason to have the ORM do it for you (I'm not a database guy). If it was my app, I would probably just do this: ** def order_by_quotient(a,b): q = [] for i in range(len(a)): q.append(a[i]/b[i]) return s

Re: Problem with views and urls

2010-02-23 Thread schms
Just a guess, try adding a '$': (r'^people/$', 'IeA.gestion.views.index'), On Feb 23, 8:28 pm, "piz...@gmail.com" wrote: > Hello, > > I'm having a problem with views and url's. If I have a url called   > "people" that has a callback to "index" works fine, but if I add a   > url for parameters

Re: Problem with views and urls

2010-02-23 Thread Karen Tracey
On Tue, Feb 23, 2010 at 2:28 PM, piz...@gmail.com wrote: > Hello, > > I'm having a problem with views and url's. If I have a url called "people" > that has a callback to "index" works fine, but if I add a url for > parameters, let's say "people//" it does call the index function, > instead of the

Problem with views and urls

2010-02-23 Thread piz...@gmail.com
Hello, I'm having a problem with views and url's. If I have a url called "people" that has a callback to "index" works fine, but if I add a url for parameters, let's say "people//" it does call the index function, instead of the defined one. If I change it, for example to "ppl//" it works

Re: integration of non-sql

2010-02-23 Thread Waldemar Kornewald
On Feb 23, 11:56 am, Joan Miller wrote: > Will be there interation for non-sql databases as MongoDB? We're working on it. Blog: http://www.allbuttonspressed.com/blog/django Discussion group: http://groups.google.com/group/django-non-relational Project site and documentation (not yet finished):

custom method in view/models

2010-02-23 Thread soFh
Dear All, i am just trying to learn django in various ways . And i need your help as i am bit confused here . I have two "class"es in my models , there is no relation among these both tables in database. in my view i want that when user retrieve data from one table in my html table one column sho

Re: Adding a new language to Django?

2010-02-23 Thread derek
Unfortunately not; this only deals with an application, not Django itself, and not the Admin interface. On Feb 22, 4:28 pm, Daniel Roseman wrote: > On Feb 22, 2:16 pm, Derek wrote: > > > I'm sure I am using the wrong search terms, but I am trying to find out how > > add a new language to "skin"

Re: usage of conditional blocks

2010-02-23 Thread joep
Side stepping the pie fight here (although a language, simple or not, that includes 'conditional' logic that doesn't apply under certain conditions because it is "easier" begs an awful lot of questions), I simply wonder if there is a way to solve my problem without resulting to writing a set of tem

jobs in london

2010-02-23 Thread timjdavey
Hi there, just wondering what everyone thought was the best place to find good django people/jobs in london? I know of http://djangogigs.com/ http://djangopeople.net/ anything else? We're looking for a strong front end guy http://blog.secretcities.com/2010/02/23/django-contractor-secretlondon-nee

Re: question regarding blocks in templates

2010-02-23 Thread Shawn Milochik
Both forks are not being executed within the 'if' block. The template is validated before being rendered, and it fails validation so it's not even getting that far. So just put the block tags outside the 'if' block and you will be fine. I'm not clear on what you were getting at in the 'BUT, I a

Re: Problem with defer

2010-02-23 Thread Bill Freeman
How do you know they weren't deferred? You can still access them if they were, IIUC. It just causes additional queries, behind the scenes. On Mon, Feb 22, 2010 at 12:31 PM, Dexter wrote: > Oh, I'm sorry, > > no error appears, but the queryset returns the complete objects with all the > fields,

Re: integration of non-sql

2010-02-23 Thread Dexter
You don't have to use the standard managers, You could search for a orm with MongoDB support. I can't see why the dev's should integrate support for such db. Grtz, Dexter On Tue, Feb 23, 2010 at 11:56 AM, Joan Miller wrote: > Will be there interation for non-sql databases as MongoDB? > > -- >

Multiple CAS Servers

2010-02-23 Thread Dan Gentry
In the early stages of writing an app that will serve two constituencies, each with their own CAS service. (I work at a university, and we serve both staff/students and alumni.) The idea is to attempt authentication with the first CAS server, and try the other if the first is unsuccessful. I've

Question about Django ORM

2010-02-23 Thread P.R.
Hello, I have question about type of design patterns using in Django ORM. It is: Table Data Gateway, Row Data Gateway, Active Record or Data Mapper? .. Personally I think that it's mix of Row Data Gateway and Data Mapper, but I want to ask for sure :-) Thanks, regards, P.R. -- You received this

pdf to xml

2010-02-23 Thread saurabhpres...@gmail.com
is there any extension or package which can convert .pdf to .xml in django -- 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 django-

Re: usage of conditional blocks

2010-02-23 Thread Shawn Milochik
Okay. If your point is that you understand the way it's meant to work and you don't agree with it, then the answer to your question is that you can't do it that way in Django's templating system. I don't know why the Django developers made that decision, but I'd bet it makes template validatio

Re: usage of conditional blocks

2010-02-23 Thread joep
Sorry, meant to post this in the developer area. On Feb 23, 12:46 pm, joep wrote: > This is in regard to this ticket,http://code.djangoproject.com/ticket/10975, > which states, in response to the user's complaint, that 'A block > cannot be defined conditionally within any sort of "if" construct,

Re: to_field connected to field in UserProfile

2010-02-23 Thread django_is
Thank you for your response. But how would the Orders model field for payment look like? Should it look like that: payment = models.ForeignKey(CustomerProfile, related_name="order_customer_payment",verbose_name='Zahlungsart') I don't understand how that should work. At the moment I am quite conf

order_by a quotient?

2010-02-23 Thread Tairic
I've been searching the Django docs and other resources and haven't been able to find a good solution to my problem. I have a model with a remaining records and total records field, and I want to order the queryset by their quotient, remaining_records / total_records. x = models.Data.objects.filte

usage of conditional blocks

2010-02-23 Thread joep
This is in regard to this ticket, http://code.djangoproject.com/ticket/10975, which states, in response to the user's complaint, that 'A block cannot be defined conditionally within any sort of "if" construct, and this is by design; the structure of the template is the structure of the template. '

Re: question regarding blocks in templates

2010-02-23 Thread joep
The relevant part of what I am trying to do is this: {% if form_included %} {% block header %} {{ form.media }} {% endblock %} {{form.as_p}} {% endif %} That is, I have a form with several widgets, each with some javascript and css files attached, but I only want to put them within the b

Re: to_field connected to field in UserProfile

2010-02-23 Thread Daniel Roseman
On Feb 23, 11:56 am, django_is wrote: > Hmm ok. Assuming the use case above what would be the correct way to > solve this problem? Especially to have the possibility to have one > field in the Orders table that allows me to select one payment method > of the methods which got added to the one spec

does current aggregation api support counting by month?

2010-02-23 Thread Manolis
Hello, I have a model like this: class Report(models.Model): date_submitted = models.DateTimeField() I want to calculate some aggregate counts per month. The SQL query for this would be: SELECT YEAR(date_submitted), MONTH(date_submitted), count(id) FROM Report GROUP BY YEAR(date_submitted), MO

Fascism is coming to Internet

2010-02-23 Thread Joan Miller
*Sorry by this off topic message, but this is too important* Fascism is coming fastly to Internet because is the only communication way that governements (managed by the bank and multinationals) cann't control http://www.boingboing.net/2010/02/21/acta-internet-enforc.html -- You received this m

Signals and exceptions

2010-02-23 Thread Lauri Võsandi
Hello everybody, I heard that using exceptions in signals might cause undetermined state in Django. By exceptions in signals I mean raising exceptions in the signal handlers. Can anybody elaborate on this because I couldn't find any information about this.. Lauri -- You received this message be

Re: Adding a new language to Django?

2010-02-23 Thread Daniel Roseman
On Feb 23, 2:31 pm, derek wrote: > Unfortunately not; this only deals with an application, not Django > itself, and not the Admin interface. What else do you need to know other than what's on that page? Translating Django *is* exactly the same as translating your own application. As the first box

question regarding blocks in templates

2010-02-23 Thread joep
I ran across some unexpected behavior. I'm using django 1.1. I tried the following: {% if something %} {% block head %} some stuff here... {% endblock %} {% else %} {% block head %} some other stuff here.. {% endblock %} {% endif %} But I get: Exception Type: TemplateSy

Re: to_field connected to field in UserProfile

2010-02-23 Thread django_is
Hmm ok. Assuming the use case above what would be the correct way to solve this problem? Especially to have the possibility to have one field in the Orders table that allows me to select one payment method of the methods which got added to the one specific user. Adding payment methods to each user

Re: to_field connected to field in UserProfile

2010-02-23 Thread Daniel Roseman
On Feb 23, 10:21 am, django_is wrote: > Hello. > > I got the following use case: > > > Customer has Payment methods (many to many) > Customer is a Proxy class of User and Customer has a profile which is > connected with AUTH_PROFILE_MODULE to the User/Customer. > > Each order has one customer

integration of non-sql

2010-02-23 Thread Joan Miller
Will be there interation for non-sql databases as MongoDB? -- 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 django-users+unsubscr..

to_field connected to field in UserProfile

2010-02-23 Thread django_is
Hello. I got the following use case: Customer has Payment methods (many to many) Customer is a Proxy class of User and Customer has a profile which is connected with AUTH_PROFILE_MODULE to the User/Customer. Each order has one customer and one payment method (one payment method from the met

Re: Problem with memcache - very bad performance

2010-02-23 Thread Szymon
Hello again, I've changed backend to pylibmc (using some custom backend found in Google, that needed some changes to work) , installed Memcached on local WWW box (it was on DB box before), connecting via socket... and... 2.5% 0.009 /home/www/dev/mc.py But we will see in few hours, when traffic