Re: slow tests on 1.1.1 w/ sqlite

2009-11-13 Thread Russell Keith-Magee
On Sat, Nov 14, 2009 at 2:39 PM, Phlip wrote: > The answer: > > While all tests should use the transaction-rollback trick, and it > seems the sqlite3 handlers don't use it... > > ...the primary culprit turned out to be this: > >  fixtures = ['countries'] > > Even though the

Re: slow tests on 1.1.1 w/ sqlite

2009-11-13 Thread Phlip
The answer: While all tests should use the transaction-rollback trick, and it seems the sqlite3 handlers don't use it... ...the primary culprit turned out to be this: fixtures = ['countries'] Even though the tests run in an app with a fixture with a very short list of sample countries &

django-tagging causing str error

2009-11-13 Thread neridaj
I'm using django-tagging and I think it's causing an error when I try to access the admin page. If I comment out the urls that reference django-tagging views the error goes away. from django.conf.urls.defaults import * from blog.models import Entry, Link from tagging.models import Tag

Re: CSV to JSON snippet

2009-11-13 Thread Karen Tracey
On Fri, Nov 13, 2009 at 10:57 PM, Zeynel wrote: > Thanks, I tried but this did not work either: > > >>> csv2json.py sw.csv wkw1.Lawyer > > File "", line 1 >csv2json.py sw.csv wkw1.Lawyer > ^ > SyntaxError: invalid syntax > >>> > > You need to run the .py

Does anybody have ADMIN rights to "djangosnippets.org"?

2009-11-13 Thread Richard E. Cooke
I'm trying to get an ID on this system and its stuck trying to e-mail me an "activation" e-mail! I'm using SPF on my server to reduce spam (very effective) but the underlying server they are using is not configured properly. The error message is: Nov 13 17:53:45 mail4.local.scom.ca

Re: CSV to JSON snippet

2009-11-13 Thread Zeynel
Thanks, I tried but this did not work either: >>> csv2json.py sw.csv wkw1.Lawyer File "", line 1 csv2json.py sw.csv wkw1.Lawyer ^ SyntaxError: invalid syntax >>> I checked "stdin" but I didn't understand how it relates to this case:

Re: Can I change the restriction on "username" without breaking anything?

2009-11-13 Thread Richard E. Cooke
I get nervous when all the examples and code snippets I find are several year old. This code snippet: http://www.djangosnippets.org/snippets/74/ works in principal, but relies on a regular expression test that is no longer defined n Django. I changed it to use a regex I use in server-side mail

Re: foreign key error on syncdb

2009-11-13 Thread Bobby Roberts
ok disregard this... i figured out that i needed to put a related_name parameter On Nov 13, 5:03 pm, Bobby Roberts wrote: > I've got a model... it's pretty simple and has an ID, description, and > a date_added field. > > I've got another model with id, option1, option2,

Re: [1.1] Problem with unmanaged models and unit testing

2009-11-13 Thread Craig Kimerer
Probably a constraint problem on the tables being created. Logging into to your MySQL server via command line and running either 'show myisam status' or 'show innodb status' (depending on what type of tables you are making) should provide you with more useful information. Craig On Fri, Nov 13,

Re: Is there a way to integrate php to a django app?

2009-11-13 Thread Juan Hernandez
Well, technically everything is possible and I think that the proper thing to ask would be "is it worth it"? On 11/13/09, Allen wrote: > Hi, all: > > I've build a application with django, and my friends build a part of > the application with php. > now both of us are

Re: [1.1] Problem with unmanaged models and unit testing

2009-11-13 Thread Russell Keith-Magee
2009/11/14 Tomasz Zieliński : > Hello > > I have a problem with when trying to test app that is using unmanaged > models: > > (...) > Creating table sometable > Traceback (most recent call last): >  File "H:\myproject\manage.py", line 11, in >    

Is there a way to integrate php to a django app?

2009-11-13 Thread Allen
Hi, all: I've build a application with django, and my friends build a part of the application with php. now both of us are finished, the final step is to integrate the php part to django, is there a way to do this? I've google for this, but no solution found. Thanks! Best Regards! Allen

Re: updating parent model on inline creation

2009-11-13 Thread Preston Holmes
On Nov 13, 5:13 pm, Preston Holmes wrote: > if submission.status == "submitted" and submission.reviews.count > 0: > submission.status = "pending review" > > Are there even simpler ways to do this that I haven't thought of? answering myself - sorry: I should just put that

updating parent model on inline creation

2009-11-13 Thread Preston Holmes
I'm setting up a conference website where a submission will have one or more "reviews" I've got the reviews set as inlines for submissions in the admin The submission model has a "status" field that needs to go through steps like "submitted" and "pending review" What I'd like to do is when the

Questions about ContentType generic relations

2009-11-13 Thread Continuation
How do I do queries when ContentType is involved? Using the example in the doc ( http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1 ) class TaggedItem(models.Model): tag = models.SlugField() content_type = models.ForeignKey(ContentType) object_id =

Re: QuerySet Question

2009-11-13 Thread Matt Schinckel
On Nov 14, 1:01 am, Chris wrote: > Thanks for your reply. > > From reading around it sounds as though I am probably not meant to > solve this in the template (though this does seem like the easier > option). > > I have figured out that I could solve this through an

foreign key error on syncdb

2009-11-13 Thread Bobby Roberts
I've got a model... it's pretty simple and has an ID, description, and a date_added field. I've got another model with id, option1, option2, option3, date_added The intent is to setup option1,option2,option3 as foreignkey fields back to the id in model #1 I get the following error when i try

Re: Need help with Query: Q Objects and .extra()

2009-11-13 Thread Tomasz Zieliński
On 13 Lis, 20:58, Info Cascade wrote: >  art_list = Article.objects.filter(status__status='PUBLISHED', >                 QExtra(where=['title_tsv @@ plainto_tsquery(%s)'], >                     params=[term])) | > Q(tags__name__icontains=term)).distinct() I'm not

[1.1] Problem with unmanaged models and unit testing

2009-11-13 Thread Tomasz Zieliński
Hello I have a problem with when trying to test app that is using unmanaged models: (...) Creating table sometable Traceback (most recent call last): File "H:\myproject\manage.py", line 11, in execute_manager(settings) File "C:\Python26\lib\site-packages\django\core\management

Need help with Query: Q Objects and .extra()

2009-11-13 Thread Info Cascade
Hi -- I need help with a query! Currently using .extra to do full text query on the article.title field. art_list = Article.objects.filter(status__status='PUBLISHED') art_list = art_list.extra( where=['title_tsv @@ plainto_tsquery(%s)'], params=[term]) That works great. I want to add the

Jobbet symfony like tutorial?

2009-11-13 Thread Xan
Hi, I'm new in django. I gone from symfony. I decide to give a try to django. Well, for starting I want a jobbet ([http://www.symfony- project.org/jobeet/1_2/Doctrine/en/]) tutorial in django (30 days or less in symfony for constructing a real project). And if it's possible in pdf format for

Re: Problem with ModelFormSet

2009-11-13 Thread ses1984
Thanks so much for pointing this out! Some time ago, I did change the model from a float to a decimal field. I did not think it would be an issue. I was also just reading about needing to manually update the database when the model is change. I didn't connect that with my problem, because, using

Re: CSV to JSON snippet

2009-11-13 Thread BenChapman
At line 21 of csv2json.py, change "import simplejson" to "from django.utils import simplejson" Now try running the csv2json.py script from the command line: python csv2json.py sw.csv wkw1.Lawyer See if that solves the problem. Best, Ben On Nov 12, 2:14 pm, Zeynel

Re: Upload Progress Bar

2009-11-13 Thread John D Giotta
Thanks, Patrick. Looks good! -- 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...@googlegroups.com. For more

Re: Problem with ModelFormSet

2009-11-13 Thread Karen Tracey
On Fri, Nov 13, 2009 at 11:52 AM, ses1984 wrote: > Here's the traceback. > Traceback shows the error is being raised during save of an existing object. So forget all the formset stuff and focus on the question that raises: can you re-save an instance of this model right

Re: Problem with ModelFormSet

2009-11-13 Thread ses1984
Here's the traceback. Sorry I didn't post it before; I'm new at this. Environment: Request Method: POST Request URL: http://192.168.0.10:8000/qc/newsession/ Django Version: 1.0.2 final Python Version: 2.5.2 Installed Applications: ['django.contrib.auth', 'django.contrib.databrowse',

Re: Upload Progress Bar

2009-11-13 Thread patrickk
We´ve been using Uploadify with the django-filebrowser and it works quite well. Code is here: http://code.google.com/p/django-filebrowser/ regards, patrick On 13 Nov., 16:55, John D Giotta wrote: > Can you provide details to setting this up? It seems everywhere I look > its

Re: View using 2 models

2009-11-13 Thread bruno desthuilliers
On 12 nov, 13:15, EmileZola wrote: > Well, I missed the point apparently. I was unaware django created > reverse attribute for ForeignKey. http://docs.djangoproject.com/en/dev/ref/models/relations/#ref-models-relations HTH -- You received this message because you are

Debugging loaddata

2009-11-13 Thread Zeynel
Since my attempt to use sqlcustom to insert some data into my SQLite3 database failed I was trying to use a JSON fixture. But when I tried it, I got this traceback. Can anyone help me locate these files so that I can understand what the error is? (I don't know where to find the referenced files)

Re: Upload Progress Bar

2009-11-13 Thread John D Giotta
Can you provide details to setting this up? It seems everywhere I look its always half explained. -- 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

Re: Apache2 installation

2009-11-13 Thread Mario
You need revisit your project urls.py and also verify your project settings.py. Does your urls.py somewhat resemble the following: from django.conf.urls.defaults import * from django.contrib import admin from django_apps.blog.models import Post urlpatterns = patterns('', (r'^contact/',

Re: Scanning uploads for viruses

2009-11-13 Thread Brandon Taylor
Thank you very much for the reply David. I was compiling ClamAV from source very late last night, but if I can go through apt-get, I'll certainly do that. I'm with you, I would certainly rather catch these on the upload than the download. I tried to talk the client into only using a the text from

Re: sqlcustom

2009-11-13 Thread Zeynel
I found these two previous queries: http://groups.google.com/group/django-users/browse_thread/thread/e692a073b88c15f2?fwc=1 Does anyone know what is "rest" subcommand?

Re: QuerySet Question

2009-11-13 Thread Chris
Thanks for your reply. >From reading around it sounds as though I am probably not meant to solve this in the template (though this does seem like the easier option). I have figured out that I could solve this through an SQL statement as follows: select *, (select Count(*) FROM shop_track_owners

sqlcustom

2009-11-13 Thread Zeynel
I am trying to add some records to my SQLite3 database with sqlcustom as explained here http://docs.djangoproject.com/en/dev/ref/django-admin/#ref-django-admin I don't get any errors when I run C:\sw1>manage.py sqlcustom wkw1 BEGIN; INSERT INTO mkw1_lawyer (first, initial, last,

Re: Can I change the restriction on "username" without breaking anything?

2009-11-13 Thread Richard E. Cooke
Thanks David! I was wondering about doing the same thing! I had not thought of your idea of soft-switching the login name from username to email. Interesting idea. I was toying with making my own class + auth backenend so I could change the DB layout to drop email. But I could see that having

Re: Problem with ModelFormSet

2009-11-13 Thread Daniel Roseman
On Nov 13, 2:18 pm, ses1984 wrote: > In short, I have been having a hard time getting a ModelFormSet to > save. The formset is created from a queryset, and it's only intended > to edit one field of existing objects. > > After a long string of mistakes and fixes, I'm finally

Re: Problem with ModelFormSet

2009-11-13 Thread Karen Tracey
On Fri, Nov 13, 2009 at 9:18 AM, ses1984 wrote: > In short, I have been having a hard time getting a ModelFormSet to > save. The formset is created from a queryset, and it's only intended > to edit one field of existing objects. > > [snip] > I have not a clue where this

Re: Model Theory 101 - Video Sharing App

2009-11-13 Thread Preston Holmes
On Aug 26, 4:17 pm, thornomad wrote: > > Caveats: I would like to keep the original "synced" data in its own > field and the "approved" data (as edited) in separate field. I > imagine that the data first gets brought into the "edit" field, admin > may make changes and

Problem with ModelFormSet

2009-11-13 Thread ses1984
In short, I have been having a hard time getting a ModelFormSet to save. The formset is created from a queryset, and it's only intended to edit one field of existing objects. After a long string of mistakes and fixes, I'm finally stumped. The following bit of code produces a TypeError exception

Re: how to save a forms.ModelForm with extra fields?

2009-11-13 Thread jul
great. Thank you! On Nov 13, 1:42 pm, Hector Garcia wrote: > Exactly, it ignores whatever POST value not related to the model > field. You have to use f.cleaned_data['rating'] to get the rating > value and use it or save it wherever it has to be stored, as Andy > McKay

Re: Apache2 installation

2009-11-13 Thread Zeynel
Yes, finally the support decided to install it. The process was a nightmare. I don't know if this is the same with other hosting places. The documentation was horrible and just outlining the process for people who are experts, not for newbies. And now they installed the project in 2 different

Re: How to use French accent on django template?

2009-11-13 Thread Karen Tracey
On Fri, Nov 13, 2009 at 4:54 AM, Nicu Marcu wrote: > Is not coming from database, Db is postgresql, and is set to utf-8, and is > accept words with accents. > > > If you post the traceback that goes with the error someone might be able to help. Karen -- You received

Re: how to save a forms.ModelForm with extra fields?

2009-11-13 Thread Hector Garcia
Exactly, it ignores whatever POST value not related to the model field. You have to use f.cleaned_data['rating'] to get the rating value and use it or save it wherever it has to be stored, as Andy McKay pointed in his comment. Hector Garcia - Web developer, musician http://nomadblue.com/ On

Re: Scanning uploads for viruses

2009-11-13 Thread David De La Harpe Golden
Brandon Taylor wrote: > Greetings all, > > My project involves uploading Word documents (resumes), and I would > like to be able to scan them for viruses. I've found ClamAV, but > installation is proving a little testy. So, I thought I'd ping the > community for advice. Should I even be concerned

media_url tute

2009-11-13 Thread Mike Dewhirst
I have looked at the django docs (http://docs.djangoproject.com/en/dev/topics/forms/media/) which painstakingly describe how to set up MEDIA_ROOT and MEDIA_URL. Does anyone know of a tutorial or other docco which covers the topic? Thanks Mike -- You received this message because you are

Django Files Access

2009-11-13 Thread vishak
Hi All, We are having an application where there is a requirement to send a mail with attachement irrespective of accessing the application everyday. Can i take the code from the existing application without any modification in that code. Note:On weekends application may not be accessed but

Re: forms.ChoiceField and empty values

2009-11-13 Thread Monika Sulik
Sorry for the double post *blush* Not sure how that happened... The model looks something like this: class Competition(MessageboardOwner): name = models.CharField(max_length=256) type = models.IntegerField(choices=COMPETITION_TYPE_CHOICES) start = models.DateField() end =

Re: how to save a forms.ModelForm with extra fields?

2009-11-13 Thread jul
What happen to the rating field when doing the following? f = AddRestaurantForm(request.POST) f.save() Does save() only use what it needs to fill the Restaurant instance and doesn't use the rating value? On Nov 13, 5:35 am, Andy Mckay wrote: > On 09-11-12 2:33 PM, jul

Re: question about facebook connect and django voting

2009-11-13 Thread Hector Garcia
It would be much easier if you post all the models involved Hector Garcia - Web developer, musician http://nomadblue.com/ On Fri, Nov 13, 2009 at 12:54 AM, uno...@gmail.com wrote: > I'm trying to find the most efficient way to accomplish the below: > > I have a list of users

Re: how to save a forms.ModelForm with extra fields?

2009-11-13 Thread jul
I meant rating = forms.IntegerField() On Nov 13, 11:16 am, Hector Garcia wrote: > You have a rating field in your model, I don't know if it is > intentionally but then in your ModelForm, if you specify an extra > field also named 'rating' then you are overriding the one in

Re: how to save a forms.ModelForm with extra fields?

2009-11-13 Thread jul
yes you're right it should be rating = models.IntegerField(). In my Restaurant model there is no rating field, so it's not overrided. thanks On Nov 13, 11:16 am, Hector Garcia wrote: > You have a rating field in your model, I don't know if it is > intentionally but then in

Re: how to save a forms.ModelForm with extra fields?

2009-11-13 Thread Hector Garcia
You have a rating field in your model, I don't know if it is intentionally but then in your ModelForm, if you specify an extra field also named 'rating' then you are overriding the one in the model, I think. Also, such extra field in the form, shouldn't it be form.IntegerField instead of

Re: How to use French accent on django template?

2009-11-13 Thread Nicu Marcu
Is not coming from database, Db is postgresql, and is set to utf-8, and is accept words with accents. 2009/11/12 Tom Evans > On Thu, Nov 12, 2009 at 4:30 PM, rebus_ wrote: > >> 2009/11/12 NMarcu : >> > Hello all, >> > >> >

Re: Apache2 installation

2009-11-13 Thread Francois Verbeek
http://www.swimswith.com/wkw1/ returns something (SwimsWith: A Legal Who-Knows-Who)... from the admin debug page, this is the only url defined in your urls.py. so it looks like working fine, except if your urls.py contains something else, in which case, could you detail what? Francois -

Scanning uploads for viruses

2009-11-13 Thread Brandon Taylor
Greetings all, My project involves uploading Word documents (resumes), and I would like to be able to scan them for viruses. I've found ClamAV, but installation is proving a little testy. So, I thought I'd ping the community for advice. Should I even be concerned with this? My deployment server

Re: Can I change the restriction on "username" without breaking anything?

2009-11-13 Thread David Christiansen
> Which makes me wonder if the "right" way is to use a custom user > validation system, likely with the e-mail field dropped, or maybe just > aliased to the username so things that expect e-mail address find one. This is exactly how I solved this problem. I just created an authentication backed