Django Resource Usage

2009-03-05 Thread Paulo
Hi I want to install Django on my webserver, but i would like to know from you if django has an intense resource usage (memory, cpu) or it's not a concern? I'm planning to install it on some shared web servers and need to know this information, because i don't want to slow down performance on th

Re: Django Resource Usage

2009-03-06 Thread Paulo
Well, this leads me to an unknown path. Where i can find more information about how to install it and tweak it? On 6 mar, 00:04, Graham Dumpleton wrote: > On Mar 6, 1:24 pm, Malcolm Tredinnick > wrote: > > > > > On Thu, 2009-03-05 at 18:08 -0800, Paulo wrote: > > >

Re: Django Resource Usage

2009-03-06 Thread Paulo
My main concern is about django in standby. Does it take too much resources? Not too much customers will be using it so i guess it's not a problem. On 5 mar, 23:08, Paulo wrote: > Hi > > I want to install Django on my webserver, but i would like to know > from you if djan

Advice on installing Django in a fresh OSX Lion machine

2012-04-09 Thread Paulo
Im new both to Python and Django and I'm afraid of messing thins up before I even start. Lion ships with Python 2.7.1 but I see that 2.7.2 is available in the official site. Should I download .dmg file from the site to update to version 2.7.2? I found this tutorial [1] and I really like the idea o

Re: Advice on installing Django in a fresh OSX Lion machine

2012-04-09 Thread Paulo
Thanks for the reply. Segunda-feira, 9 de Abril de 2012 16:23:09 UTC+1, shacker escreveu: > > On Monday, April 9, 2012 5:19:28 AM UTC-7, Paulo wrote: >> >> Im new both to Python and Django and I'm afraid of messing thins up >> before I even start. >> Lion ship

Re: Advice on installing Django in a fresh OSX Lion machine

2012-04-09 Thread Paulo
. Scanning installed packages Setuptools installation detected at /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python Not patching, --root or --prefix is installing Distribute in another location running install Checking .pth file support in /Users/Paulo/.local/lib/python2.7/site

Re: Advice on installing Django in a fresh OSX Lion machine

2012-04-10 Thread Paulo
lping. [1] - http://hackercodex.com/2011/08/30/python-install-django-on-mac-osx-lion-10.7/ Terça-feira, 10 de Abril de 2012 12:59:50 UTC+1, Daniel Roseman escreveu: > > On Tuesday, 10 April 2012 00:00:32 UTC+1, Paulo wrote: >> >> So I follow your advice and did sudo easy_install

Re: Blog engine

2007-07-17 Thread Paulo
No to mention a good blog app that people can standardize on would be a nice alternative to Wordpress[1] and Simplelog[2]. Having one would definitely be helpful in the "spreading the word about Django" department. We made the switch to Django/Python over a year ago for our client work and it was

Re: Tools for writing HTML templates

2007-01-27 Thread Paulo
This could turn into a religious debate... but I give TextMate two thumbs up! < http://macromates.com/ > On 1/27/07, Andrew Diederich <[EMAIL PROTECTED]> wrote: > > I'm looking for a tool for our non-programmers to develop the HTML > templates for django. Our python folks can help stick in the

Re: Tools for writing HTML templates

2007-01-28 Thread Paulo
> TextMate looks nice, but I don't have a mac. We've primarily been a > windows shop, with a handful of linux and solaris servers. Have you > run into anything your windows friends like? These have all been recommended to me in the past but I do not have much experience with them since I can't

[MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-06 Thread Paulo
Hi, Apologies in advance for the long post but I have hit a brickwall: How do you get django and MySQLdb to talk to each other? I have been banging my head against the wall trying to get past "The development server" per the django tutorial at < http://www.djangoproject.com/documentation/0_91/tu

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-06 Thread Paulo
Hi Luke, Thanks for the reply. > The fundamental problem is probably this line: > Could not load database backend: cannot import name ImmutableSet. > > I'm guessing that your PYTHONPATH isn't set up correctly, but I can't be > sure. It's a good place to start looking. If it is, then you need t

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-08 Thread Paulo
st the wall* I basically followed the instructions at < http://sourceforge.net/docman/display_doc.php?docid=32072&group_id=22307#building-and-installing > to build the latest version of MySQLdb. On 5/8/06, Andy Dustman <[EMAIL PROTECTED]> wrote: > > On 5/6/06, Paulo <[E

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-10 Thread Paulo
okie" friendly list, etc. I would love to check it/them out. Thanks! On 5/9/06, Andy Dustman <[EMAIL PROTECTED]> wrote: > > On 5/8/06, Paulo <[EMAIL PROTECTED]> wrote: > > > > Thanks for the tip! I will check it out when I get home this evening. > > I'

Re: [MySQLdb] Could not load database backend: cannot import name ImmutableSet.

2006-05-10 Thread Paulo
Got ya. If it helps it is a bare CentOS 4.3 install. I'll keep plugging away then. Thanks again for everyone's help. On 5/10/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > Paulo, > > On Wed, 2006-05-10 at 14:54 -0700, Paulo wrote: > > Can someone po

Re: Wiki or Blogs done with django

2006-05-30 Thread Paulo
This list rocks! Thank you all for providing your code for us to take a look at. I've finally gotten Django working on my Powerbook and CentOS box and am in the process of writing a portfolio/blog app to get more acquainted with how the framework works. Being able to see how others approach thing

Re: Wiki or Blogs done with django

2006-05-31 Thread Paulo
agreed -- I am not doing much from scratch. I am new to using web frameworks (I'm just a project manager who likes to dabble in design/code so I can better understand what the Dev/Creative teams go through) and I'm pretty much using generic views to get my feet wet with how Django works on a highe

Re: Django Boot Camp

2006-06-29 Thread Paulo
add my vote for both. screencasts would be a great start with real-world bootcamps once the final release is out. On 6/28/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/28/06, keukaman <[EMAIL PROTECTED]> wrote: > > Does anyone have any thoughts on a "boot camp" for prospective Django >

Re: book recommendations?

2006-07-10 Thread Paulo
When someone asks me how to dive in and learn XHTML/CSS I always recommend: < http://www.simplebits.com/publications/ > < http://www.cssmastery.com/ > < http://beginningwebdesign.com/ > < http://www.idest.com/csshacks/ > To get a hang of some of the newer DOM scripting techniques: < http://www.do

[Django Publicity] Cameron Moll's Screen Grab Confab

2006-07-13 Thread Paulo
This is slightly OT, and I apologize if this has been posted already, but I thought it was pretty darn cool... In 60+ entries (already) I've seen reference to *three* different posts where people were working with django. Check it out < http://www.cameronmoll.com/archives/001045.html >. --~--~---

Re: Is Django the framework I've been looking for?

2006-07-20 Thread Paulo
+1 on the portability of apps. We're doing something very similar for our client projects. Since moving to Django we have: - increased our cash flow by being able to hammer out more "small-ish" projects in a shorter amount time - decreased our dev time -- we're finding ourselves waiting on cl

Re: Blank page for admin

2006-07-24 Thread Paulo
You can also tunnel into your server and forward port 8000. I do this when I am building/testing things on my server: %: sudo ssh -L 8000:localhost:8000 [EMAIL PROTECTED] Then just fire up "http://localhost:8000"; in your fave web browser. On 7/24/06, Kenneth Gonsalves <[EMAIL PROTECTED]> wrot

Re: Django Blog software

2006-08-20 Thread Paulo
I think Wordpress would be a decent model to look at. Askimet is great, trackback/pingback support is nice, but while WP is fairly easy to install it is starting to get bloated. The Ajaxy admin area is ok but make sure ajax is being used to improve the UI not "make it look cool". Less is more, m

Re: Dreamhost: admin works, rest doesn't

2006-08-25 Thread Paulo
Go checkout DH's status page < http://status.dreamhost.com/ >. You MySQL DB server might have been knocked offline. If your sites' uptime is important to you get as far away from DH as possible. Granted you get what you pay for so a $12 hosting account with more bells and whistles than you can ev

[SLIGHTLY OT] Adrian to speak at Web Directions North

2006-09-25 Thread Paulo
Apologies if this has been posted to the list already but I just learned about this. It looks like Adrian will be speaking at Web Directions North in Vancouver next Feb. 6-10 < http://north.webdirections.org/detail/speakers/#holovaty >. Pretty damn cool! --~--~-~--~~~-

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-04 Thread Paulo Almeida
Hi Alex, When I do that I get a 404 instead of a 302. I also tried changing urls.py to have a trailing slash but that also gives me a 404. Byt the way, one of the variables I get in response.context is: {'request_path': u'/myflow/experiment/1/'} Thanks for the reply, Paulo

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-04 Thread Paulo Almeida
re that is coming from. I guess I'll have to figure it out, because it seems to be the key to the problem. Thanks for the reply, Paulo Almeida On Tue, Aug 4, 2009 at 6:18 PM, Karen Tracey wrote: > On Tue, Aug 4, 2009 at 12:26 PM, palmeida wrote: > >> >> Hi, >> >>

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-04 Thread Paulo Almeida
look at response['location'] with and without APPEND_SLASH to see if that is doing anything. Thanks again, Paulo On Tue, Aug 4, 2009 at 6:45 PM, Karen Tracey wrote: > On Tue, Aug 4, 2009 at 1:33 PM, Paulo Almeida > wrote: > >> Hi Karen, >> >> You're

Re: Login screen is always shown, i dont like it :/

2009-08-04 Thread Paulo Almeida
login can redirect to your start page and the 'next' variable will take care of redirecting to the original page, if any, so that situation you don't like would never arise. That said, I don't know if it's possible to do what you asked without writing your own view. - Pa

Re: model upload_to

2009-08-04 Thread Paulo Almeida
For what it's worth, if all you want to do is change the upload folder, you can also do it by overriding the form's __init__. - Paulo On Tue, Aug 4, 2009 at 9:28 PM, Stefan Hjelm wrote: > > ok don't know what typo I made yesterday but it works now, maybe > backslash in p

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-05 Thread Paulo Almeida
and as it works outside tests. Also, from that /myflow/experiments response.content I can tell that the fixtures are being loaded, so it should not be a problem of experiment 1 not existing. If you can suggest anything else I may try, please do. Thank you, - Paulo Almeida On Tue, Aug 4, 2009 at 9:27 PM

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-05 Thread Paulo Almeida
suggest to try and narrow down the problem. Thanks, Paulo On Wed, Aug 5, 2009 at 10:57 AM, Malcolm Tredinnick < malc...@pointy-stick.com> wrote: > > On Wed, 2009-08-05 at 10:45 +0100, Paulo Almeida wrote: > > Ok, so with APPEND_SLASH = False , I get a 404 (so no > &g

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-05 Thread Paulo Almeida
there anymore. I suppose that rollback is the difference that made the test work with unittest. Thanks for all the help, Paulo On Wed, Aug 5, 2009 at 11:11 AM, Paulo Almeida wrote: > Hi, > > Thanks for the suggestion. I will do that now, but in the mean time I > realized the 404

Re: default blank choice on form.Form select widget

2009-08-05 Thread Paulo Almeida
Did you see this ticket? http://code.djangoproject.com/ticket/4092 Maybe you can use the patch code to customize your field. - Paulo On Wed, Aug 5, 2009 at 8:01 PM, JHeasly wrote: > > The doc page "Creating forms from models" > (http://docs.djangoproject.com/en/dev/topi

Re: Select Table or Database based on User

2009-08-05 Thread Paulo Almeida
Yeah, the way I do that is have a foreign key with the user in the table with private data and then filter by user when retrieving data in the view. On Wed, Aug 5, 2009 at 10:11 PM, Maksymus007 wrote: > > > > > Hi everyone, > > > > I'm sure this has come up in the past, but I sincerely can't fin

Re: Application decoupling - project architecture question

2009-08-06 Thread Paulo Almeida
bably do something similar with an AvatarField. - Paulo On Thu, Aug 6, 2009 at 4:07 PM, Andrin Riiet wrote: > > Hi, I'd like to shed some light on the "the right way" to make > applications in django by an example and a few questions. > > Let's say that I hav

Re: Get current user outside a view / without an request object

2009-08-06 Thread Paulo Almeida
t;" Generate form to handle experiment information. """ def __init__(self, user, *args, **kwargs): super(ExperimentForm, self).__init__(*args, **kwargs) try: preferences = Preferences.objects.get(user=user) That last 'user' is just what

Re: Get current user outside a view / without an request object

2009-08-06 Thread Paulo Almeida
But why don't you put: recipientUser = ShowValidContactList(currentUser=self.user) inside the __init__? - Paulo 2009/8/6 Julián C. Pérez > > Thanks for reply, Paulo > But if I... > --- > class SendMessageForm(forms.Form): > >recipientUser = ShowValidContact

Re: Django TimeField Model without seconds

2009-08-06 Thread Paulo Almeida
Hi, Streamweaver wasn't suggesting assigning 00 to every time, just hiding what you don't want to show using views or templates. For instance: http://docs.djangoproject.com/en/dev/ref/templates/builtins/#time - Paulo On Thu, Aug 6, 2009 at 6:47 PM, Hellnar wrote: > > Hell

Re: why so slow?

2008-06-03 Thread Paulo Abreu
chine (VirtualBox) Paulo Abreu begin:vcard fn:Paulo Abreu n:Abreu;Paulo org:ClusterCube, Lda. adr;quoted-printable:Edif=C3=ADcio Inova=C3=A7=C3=A3o I sala 212-B;;Taguspark - Avenida Jacques Delors;;;2740-122 Porto Salvo;Portugal email;internet:[EMAIL PROTECTED] tel;work:214 222 011 tel;cell:913 234

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Paulo Köch
A background sleeper (as opposed to worker) that would fire a signal upon timer expiration seems like a nice mechanism. Cheers, Paulo Köch On Tue, Mar 17, 2009 at 01:04, Jeff FW wrote: > > When you say "audit"--what do you mean?  By that, I mean, what do you > plan to do

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Paulo Köch
And it's clearly a feature request. Bug implies defect in implementation, not formulation. Cheers. --~--~-~--~~~---~--~~ 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

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-17 Thread Paulo Köch
n and related stuff. HTH. Cheers, Paulo Köch --~--~-~--~~~---~--~~ 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 from this group

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-17 Thread Paulo Köch
roach. Assuming you don't need realtime audit logs, can you exploit the expired sessions not being automatically cleaned up? Cheers, Paulo Köch On Tue, Mar 17, 2009 at 20:28, Huuuze wrote: > > Paulo, thank you for the link, but I don't see how that will help.  To > help articul

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-17 Thread Paulo Köch
ession(self, session_id): """Forfeits user tracking. For logouts and such.""" if self.pool.haskey(session_id): current_timer = self.pool[session_id] if current_timer.isAlive(): current_time.cancel() # Don't kow

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-17 Thread Paulo Köch
Argh! Code in emails sucks. Besides, there was a typo in the previous email. See http://dpaste.com/15848/ Cheers, Paulo Köch --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-17 Thread Paulo Köch
On Wed, Mar 18, 2009 at 01:06, Malcolm Tredinnick wrote: > There's no guarantee that the same session > will go to the same process (not to mention that the processes will stop > and start over time). > > If you're going to do something like this, it has to be external from > the web-process life

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-17 Thread Paulo Köch
;t this generate a new session_id? Cheers, Paulo Köch --~--~-~--~~~---~--~~ 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 from t

Re: RichTextField widget for django

2009-03-20 Thread Paulo Köch
Thank you! Cheers, Paulo Köch On Fri, Mar 20, 2009 at 14:27, Greg Fuller wrote: > > http://code.google.com/p/django-fckconnector/ > http://code.google.com/p/django-tinymce/ > > On Mar 20, 7:37 am, Joshua Partogi wrote: >> Dear all, >> >> Does anyone know w

Re: Join unrelated models

2009-03-24 Thread Paulo Köch
Does that generate a join or a not in? This is very relevant for performance. Cheers, Paulo Köch On Tue, Mar 24, 2009 at 20:13, Alex Gaynor wrote: > > > On Tue, Mar 24, 2009 at 4:05 PM, Konstantin S wrote: >> >> Hello! >> >> I have two unrelated

Re: how to make readonly in change but editable in add?

2010-08-04 Thread Paulo Almeida
(s) read only. - Paulo On Wed, Aug 4, 2010 at 4:03 AM, shmengie <1st...@gmail.com> wrote: > I cobbled these two classes together which work very nicely for me, > wish they could make into django. > Drop these two classes into a util.py and import them instead of Form > or Mo

Re: problem : create form

2010-08-04 Thread Paulo Almeida
Hi, SQL is created for models, not for forms. Maybe you should try following the tutorial first (it's near the top of the Django documentation page), and then move to other documentation for the specifics. - Paulo On Wed, Aug 4, 2010 at 9:19 AM, Jagdeep Singh Malhi wrote: > i foll

Re: problem : create form

2010-08-04 Thread Paulo Almeida
If possible, the easiest way would be to create a form based on a model (subclass ModelForm). When you save the form the values will be stores in the appropriate database fields. To answer your final question, the 4 part tutorial I mentioned covers that. - Paulo On Wed, Aug 4, 2010 at 10:09 AM

Re: Saving formsets with multiple databases

2010-08-04 Thread Paulo Almeida
't know if that works or if there is a better method. - Paulo On Tue, Aug 3, 2010 at 11:05 PM, Melanie wrote: > I am developing a formset for an application which uses multiple > databases. On load of the formset, I am able to utilize: > > model.objects.using(database).get(id) &g

Re: How to get the model name of an object in template?

2010-08-05 Thread Paulo Almeida
But _meta starts with an underscore, so you can't use it in the template, right? I'm still using Django 1.0.2, so I don't know if that has changed along the way. - Paulo On Thu, Aug 5, 2010 at 8:52 AM, Daniel Roseman wrote: > On Aug 4, 7:27 pm, "David.D" wrote:

Re: Need help with my Form.save() method. Trouble with ForeignKey and ManyToMany Fields.

2010-08-05 Thread Paulo Almeida
Can you check the POST data and see if 'username' is there? You can do it easily with Firefox's Firebug extension. - Paulo On Thu, Aug 5, 2010 at 6:24 AM, strayhand wrote: > So I'm rolling out my own registration form that should update the > following model

Re: overriding model.save()

2010-08-05 Thread Paulo Almeida
I never tried this, but I think you could just delete the value from the form.cleaned_data dictionary, if you don't want it: if instance.my_field == some_value: del form.cleaned_data['my_field'] This would be in the view, before saving, so you wouldn't need to override an

Re: Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-05 Thread Paulo Almeida
In the third case, I didn't understand why you didn't divide (his_to - his_from) / (my_to - my_from). Bearing that in mind, this made sense in my head, but analyze it carefully: def match(mf,mt,hf,ht): mydiff = diff_in_seconds(mf,mt) if (mf >= hf and mt <= ht) or (mf < hf and mt > ht):

Re: Finding Duration: Creating a context variable from two DateField model fields

2010-08-05 Thread Paulo Almeida
A function or property in the model would do nicely. You can check this page for more information: http://www.b-list.org/weblog/2006/aug/18/django-tips-using-properties-models-and-managers/ <http://www.b-list.org/weblog/2006/aug/18/django-tips-using-properties-models-and-managers/>- Pau

Re: Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-07 Thread Paulo Almeida
with each option, so I'm not sure which would perform better. And I think yours is more readable, although less concise. - Paulo 2010/8/6 Alexandre González > M the third case coul be this, for example: > > |---A-|

Re: Newbie Mistake Question

2010-08-07 Thread Paulo Almeida
Is your project named mysite? (That is, is the parent directory of 'polls' named 'mysite'?) -Paulo On Sat, Aug 7, 2010 at 3:20 AM, HawaiiMikeD wrote: > Hi all, > > Just starting out with the tutorial 1 and ran into what I hope is a > minor mistake. I'

Re: confusing query involving time ranges

2010-08-12 Thread Paulo Almeida
r(foo=foo, last_dt__lte=dt): states.append(state.latest) Of course you would have to define latest in the model Meta. - Paulo On Thu, Aug 12, 2010 at 8:26 PM, Alec Shaner wrote: > Hopefully some django sql guru will give you a better answer, but I'll take > a stab at it. >

Re: confusing query involving time ranges

2010-08-13 Thread Paulo Almeida
I see. What about Alec Shaner's suggestion? If you replace 'order_by' with 'latest' it will be similar to my suggestion with just two queries. - Paulo On Fri, Aug 13, 2010 at 8:28 AM, Emily Rodgers wrote: > On Aug 12, 10:00 pm, Paulo Almeida > wrote: > >

ManagementForm validation error in unit test

2010-03-18 Thread Paulo Almeida
extra=1) >> data = { 'image_form-INITIAL_FORMS': u'0', 'image_form-TOTAL_FORMS': u'1' } >> formset = ImageFormset(data,prefix='image_form') This works, but if I leave out the prefix in the last command then the same ValidationError is raised.

Re: Send e-mail with large files from form attached

2010-03-18 Thread Paulo Almeida
I can't help you with the technical part, but a couple of suggestions: * Sum the size of the images and send two (or more) e-mails if it exceeds a threshold * Forget attachments and just zip the images and make them accessible in an URL that is e-mailed to the site admin - Paulo On Wed, M

Re: ManagementForm validation error in unit test

2010-03-18 Thread Paulo Almeida
) I do that both for POST and non-POST creation of formsets. Also, I searched google for get_default_prefix and it seems that all it does is return the string 'form' (or at least it did, I don't know how recent is the documentation I found). Thanks, Paulo On

Re: ManagementForm validation error in unit test

2010-03-18 Thread Paulo Almeida
Mystery solved. Thanks for your help, and sorry for the waste of time, but the problem was that I missed a previous form submission in the same test function, that was used just to test validation. I hadn't added the ManagementForm variables there, so that was the problem. Best regards, Paul

Re: models.TextField --> \r\n in DB

2010-03-18 Thread Paulo Almeida
Hi Thomas, Django's normalize_newlines function should do the trick. You can import it from django.utils.text. See this page for an example: http://www.palewire.com/posts/2009/09/01/django-recipe-remove-newlines-text-block/ Best, Paulo On Thu, Mar 18, 2010 at 4:27 PM, Thomas Guettler

Re: Send e-mail with large files from form attached

2010-03-19 Thread Paulo Almeida
Hi, My suggestion to zip the files was to provide a single download link with all the files. - Paulo On Fri, Mar 19, 2010 at 1:43 PM, tezro wrote: > Thanks for reply. I tried both variants before the post :) Nothing > suited me and the customer. > > When a-mailng files are upl

Re: UnicodeDecodeError Solution?

2010-03-19 Thread Paulo Almeida
ng something with the encode function or smart_str will help you. Good luck, Paulo On Fri, Mar 19, 2010 at 2:44 PM, Steven L Smith wrote: > We have a freelance designer that, for various political reasons, we need > to > give access to our templates directory. The problem is, he frequently

Re: login() and 'unicode' object is not callable error

2010-03-19 Thread Paulo Almeida
I think what's happening is you are assigning a string to the 'login' variable: login = request.POST['login'] So when you get to: login(request, user) login is the text and not the function. HTH, Paulo On Fri, Mar 19, 2010 at 3:15 PM, Martin Tiršel wrote: > Hel

Re: Send e-mail with large files from form attached

2010-03-19 Thread Paulo Almeida
Oh, I missed that part. I'm not an expert, so you may want to investigate alternatives, but with the shutil module you can copy files or entire directories: http://docs.python.org/library/shutil.html Look for copy and copytree. Best, Paulo On Fri, Mar 19, 2010 at 2:32 PM, tezro wrote:

Re: Two user account types and login_required decorator

2010-03-19 Thread Paulo Almeida
Hi, This ticket is pretty old, but if it turns out you need a new decorator you can try the patch: http://code.djangoproject.com/ticket/11770 Regards, Paulo On Fri, Mar 19, 2010 at 9:57 PM, Martin Tiršel wrote: > Hello, > > I am programming an application where one part is customer

Re: Forms with read only fields

2010-03-20 Thread Paulo Almeida
You can also do that by overriding the form's __init__ : http://stackoverflow.com/questions/324477/in-a-django-form-how-to-make-a-field-readonly-or-disabled-so-that-it-cannot-be You can pass the user to init and disable fields depending on that parameter. - Paulo On Sat, Mar 20, 2010 at

Re: Strings in page in []

2010-03-21 Thread Paulo Almeida
umentations says it works like a plain dict, so I would expect it to not return a list. - Paulo On Sun, Mar 21, 2010 at 11:26 PM, serek wrote: > Hi > > I use djangoflash http://djangoflash.destaquenet.com/ > and after add message to flash >request.flash.add('me

Re: installation question

2010-03-21 Thread Paulo Almeida
You should run that on the Terminal (not Python, just regular shell), in the folder where you downloaded Django-1.1.1.tar.gz . - Paulo On Sun, Mar 21, 2010 at 10:39 PM, yangyang wrote: > I'm trying to download Django on my Mac OS X 10.4.11. I have download > Python 2.6.4. And then

Re: Tagging - Extending by adding a rating?

2010-03-21 Thread Paulo Almeida
A possible solution would be to create a Many To Many relationship between articles and companies, with an intermediary model holding the ratings: http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships - Paulo On Mon, Mar 22, 2010 at 2:41 AM, Victor

Re: Tagging - Extending by adding a rating?

2010-03-22 Thread Paulo Almeida
features), but that's something you can look into. Best, Paulo On Mon, Mar 22, 2010 at 3:21 AM, Victor Hooi wrote: > Paolo, > > Thanks for the quick reply =). > > I did think of that, just using a M2M, however, that means I lose all > of the inherent features of django-tagg

Re: Event more complicated forms / templates

2010-03-22 Thread Paulo Almeida
You could use inline formsets (have CustomerContactAnswer be a formset of CustomerContactQuestion) and then render the Answer forms as a table in the template. - Paulo On Mon, Mar 22, 2010 at 1:31 PM, ALJ wrote: > Is there any to have a table type form will variable rows and columns? &g

Re: Remove session on browser close

2010-03-22 Thread Paulo Almeida
Maybe I'm missing something obvious, but can't you pass the user to the template and use: {% if user.is_authenticated %} instead of: {% if form.thanks %} It doesn't solve the problem of logging out, but you don't have to handle the session manually. - Paulo On Mon, Mar

Re: Negate querysets

2010-03-23 Thread Paulo Almeida
d the inverse. - Paulo On Tue, Mar 23, 2010 at 1:23 PM, Vinicius Mendes | meiocodigo.com < vbmen...@gmail.com> wrote: > Ok. The code proposed by Tim Shaffer works and gives only one query. > But it makes use of subselects, what is heavy for the database. Take a > look at the genera

Re: Can't perform chmod on django-admin.py

2010-03-23 Thread Paulo Almeida
You should run the command as an administrator, as mentioned. In any case, if you type something like: python /usr/bin/django-admin.py startproject project_name it should work (where /usr/bin/ is the path to the django executable). - Paulo On Tue, Mar 23, 2010 at 10:05 PM, irishsteve wrote

Re: More PYTHONPATH issues

2010-03-23 Thread Paulo Almeida
Just to clarify: if you run a python shell in /Library/Python/2.6/site-packages you can import django, but if you run anywhere else you can't? It seems weird that you can't cd into django's directory. - Paulo On Tue, Mar 23, 2010 at 9:13 PM, Riley wrote: > Hey all,

Re: Overriding admin Media class

2010-03-23 Thread Paulo Almeida
idea, you'd probably have to tweak the details. - Paulo On Tue, Mar 23, 2010 at 9:36 PM, Scot Hacker wrote: > Given an admin media class that sets up a rich text editor, like: > > class TutorialAdmin(admin.ModelAdmin): > >fields... > >class Media: >js

Re: More PYTHONPATH issues

2010-03-24 Thread Paulo Almeida
directories of the django folder and read permission in all the files within (if it's a symlink those permissions are set in the target folder, but it seems those are alright). - Paulo On Wed, Mar 24, 2010 at 1:18 AM, Riley wrote: > No when I run the shell in the directory where django

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread Paulo Almeida
I don't understand why is it obvious that an 'else' won't work. If a single {% else %} is not what you want, you can nest {% if %} clauses. But if you are doing this it can also mean that you should move this logic to the view and just pass the final table to the template. - P

Re: Templates: Looping, ifs and defaults

2010-03-24 Thread Paulo Almeida
nd columns of the HTML table. - Paulo On Wed, Mar 24, 2010 at 2:13 PM, ALJ wrote: > Just as a matter of interest ... is there a 'best way' of formatting > the data if you do decide to process it all in the view and then pass > to the template? I seem to have dictionaries

Re: change modelform values after POST

2010-03-29 Thread Paulo Almeida
form, but it can still be NOT NULL. Of course, you must make sure it is filled in some way. - Paulo On Sat, Mar 27, 2010 at 4:20 PM, tc wrote: > > > On 21 mar, 22:38, Bjunix wrote: > > You probably want to change the attributes of the model object > > directly. > >

Re: I am having issues with django test

2010-03-29 Thread Paulo Almeida
, password=PASS) response = self.client.get('/experiment/import') def test_experiment_list(self): response = self.client.get('/experiments') self.failUnlessEqual(response.status_code, 200) This works for me... I haven't tried it your way, so I don&#x

Re: Use admin widgets in inlineformset_factory

2010-03-30 Thread Paulo Almeida
I don't know what the syntax/parameter name is. - Paulo On Mon, Mar 29, 2010 at 7:43 PM, Fredrik wrote: > Hi, > I have this forms.py file > > > --- > # -*- c

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Paulo Almeida
m reportlab.platypus import Image as Platypus_Image from reportlab.lib import colors from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet - Paulo On Tue, Mar 30, 2010 at 5:08 PM, Sven Richter wrote: > Hi everybody, > > i am looking for a way to

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Paulo Almeida
Ok, that is not easy to debug with so little information. Is the IndexError in views.py? Maybe there is a mistake in urls.py, caused by adding the url for the generate_pdf view? - Paulo On Tue, Mar 30, 2010 at 7:57 PM, Sven Richter wrote: > On Tue, Mar 30, 2010 at 8:21 PM, palmeida >

Re: django, reportlab and basedoctemplate | simpledoctemplate

2010-03-30 Thread Paulo Almeida
hem. Best, Paulo On Tue, Mar 30, 2010 at 11:52 PM, Sven Richter wrote: > Shame on me. The problem was that i mixed SimpleDocTemplate (which the > examples were based on), with BaseDocTemplate, which i used. And > BaseDocTemplate needs an extra PageTemplate defined. So this code > ba

Altering object order in formsets with can_order

2010-05-05 Thread Paulo Almeida
he fields created by can_order). Does that sound reasonable? Thanks for any help, Paulo Almeida -- 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 gro

Massive insertion of records

2010-12-24 Thread Silva Paulo
I need to do a massive insertion of records in two tables "connectd" by "foreignkey". Is there a way, using the Django db API, to do it. e=Foo(...);e.save() seems too slow. Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: Massive insertion of records

2010-12-24 Thread Silva Paulo
> On Dec 24, 2010, at 9:26 AM, Silva Paulo wrote: > > > I need to do a massive insertion of records in two > tables "connectd" by "foreignkey". Is there a way, using the > Django db API, to do it. e=Foo(...);e.save() seems too > slow. > > It's alway

Re: Massive insertion of records

2010-12-25 Thread Silva Paulo
OK. I found a "solution". Using manual commitments after lots of insertions (ex. >1000) makes the massive insertion very fast (at least for my needs). Thanks to all who answered. --- On Fri, 12/24/10, Silva Paulo wrote: > From: Silva Paulo > Subject: Massive insert

Re: Massive insertion of records

2010-12-27 Thread Silva Paulo
Re: Massive insertion of records > To: "Django users" > Date: Monday, December 27, 2010, 11:29 AM > Can you explain what you mean by > "manual commitments" (preferably with > a code example)? > > Thanks > Derek > > On Dec 26, 4:38 am, Silva Paulo

Django Dynamic Fixture

2011-03-08 Thread Paulo Cheque
/django-dynamic-fixture) I think is the simplest and most complete. abs Paulo pythonsmalltalk.blogspot.com -- 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

Django Dynamic Fixture

2011-03-18 Thread Paulo Cheque
=gst&q=dynamic+fixture#d2d2f691aeb22ffd http://groups.google.com/group/django-users/browse_thread/thread/76adfe6ed07c1a71/39d203158380ee6d?lnk=gst&q=dynamic+fixture#39d203158380ee6d regards Paulo -- You received this message because you are subscribed to the Google Groups "Django us

  1   2   >