Re: Django 1.7 not working with mysql-connector-python 1.1.6 & Python 3.3 ?

2014-12-19 Thread Felipe Serrano
Same problem, your Fix works great!... Thanks, using MacOS 10.7, Django 1.7, DjanogCMS3, Python 3.4.2 -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-use

Select a single field from database (postgresql)

2014-12-19 Thread Cássio Van Helden Gameiro
Hi, i have a database with many cars, and i want to select the last car based the hour that it was registered, can someone help me? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving email

Can't open manage.py

2014-12-19 Thread Valéria Pacheco
I ran this command $ python manage.py migrate and the following error occurs python: can't open file 'manage.py': [Errno 2] No such file or directory The file exists though. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Can't open manage.py

2014-12-19 Thread Guilherme Leal
Are you sure that your shell is running on the same folder that contains the manage.py? Em Fri Dec 19 2014 at 09:53:05, Valéria Pacheco escreveu: > I ran this command $ python manage.py migrate > > and the following error occurs > > python: can't open file 'manage.py': [Errno 2] No such file or

Re: Select a single field from database (postgresql)

2014-12-19 Thread aRkadeFR
Hello Cássio, You first need to map your cars table with a Model in Django (https://docs.djangoproject.com/en/1.7/topics/db/models/), then you can construct your query something like this: Car.objects.order_by('-registered').last() Check out the documentation on queries here: https://docs.djang

Re: Database queries location

2014-12-19 Thread aRkadeFR
Depend exactly on what to compute for your post data. I would almost write no logic code in the views. I split every application as follow: - managers.py: All the logic as a table level (raw SQL, complex queries) - models.py: All logic as a row level / object level (python computing data) - form

Re: Raw access to cache table

2014-12-19 Thread Erik Cederstrand
> Den 18/12/2014 kl. 12.20 skrev Erik Cederstrand : > > Hi list, > > I'm using Django as a hub to synchronize data between various external > systems. To do this, I have some long-running Django management commands that > are started as cron jobs. To ensure that only one job is working on a da

Re: Optimizing has_perm query time on PERMISSION AND GROUP PERMISSION

2014-12-19 Thread aRkadeFR
Hey mohd, How do you know the CPU burnt come from the method has_perm? Did you dump the query and play it again? It's most likely to be something else FMPOV. The has_perm is just a simple query in DB... aRkadeFR On 12/18/2014 05:27 PM, mohd irshad wrote: Hello , I am constantly facing face ma

Revisiting the case-sensitive login for the default user manager

2014-12-19 Thread Roman Onosovski
Hello fellow Djangoers, I am new to the framework and just recently built a site using it. However I was not aware of the username hurdle until just recently. I did some research and found that I can make my own user manager and etc. Now this is probably a bit of a hack, but tell me what you thin

Model form with optional fields issue

2014-12-19 Thread marcin . j . nowak
Hello! I have model form defined with all optional fields (required=False). I want use this form to update only provided fields leaving others unchanged. But Django replaces optional fields to empty values and removes data from models. A short example: class MyForm(forms.ModelForm): class

Re: Model form with optional fields issue

2014-12-19 Thread Carl Meyer
Hi Marcin, On 12/19/2014 11:44 AM, marcin.j.no...@gmail.com wrote: > Hello! > > I have model form defined with all optional fields (required=False). > I want use this form to update only provided fields leaving others > unchanged. > But Django replaces optional fields to empty values and removes

Re: CSRF Failing after server upgrade.

2014-12-19 Thread Collin Anderson
Hi Ed, Did you figure it out? Is your login page getting cached? The CSRF token is re-generated after a successful login, so if you click "login" twice or hit back after a successful login, it won't work. Do you happen to know, specifically, which django versions you upgraded from/to? Collin

Re: Using django-nocaptcha-recaptcha problem

2014-12-19 Thread Collin Anderson
Hi, This looks like it could just be a CSS thing. You could try posting your issue on the project's github page. https://github.com/ImaginaryLandscape/django-nocaptcha-recaptcha Collin On Wednesday, December 17, 2014 6:08:54 AM UTC-5, Hossein Rashnoo wrote: > > > Hi, I use *django-nocaptcha-re

Re: Django ManyToManyField Not Displaying in Template

2014-12-19 Thread Collin Anderson
Hi, Did you figure it out? This should work: {% for p1 in partmodels %} {% for p2 in p1.partmodel_set %} {{ p2 }} {% endfor %} {% endfor %} Collin On Wednesday, December 17, 2014 9:52:19 AM UTC-5, Rodney Lewis wrote: > > Hey All: > > I need my template to iterate through each P

Re: change_list html template filter block inject a css class

2014-12-19 Thread Collin Anderson
Hi, In your custom(?) filter, you could try wrapping your text in , and then in mark_safe(), though be careful with that, security-wise. Honestly, it might be simplest to use Javascript to apply a special class after the fact. Collin On Thursday, December 18, 2014 9:54:07 AM UTC-5, Damjan Dim

Re: ModelAdmin with inlines: How to learn if/what has changed before the models are saved?

2014-12-19 Thread Collin Anderson
Hi Carsten, save_model() happens first, then save_related() which calls save_formset() on each formset. It might end up being easier to save the parent model _again_, instead of doing something before it's saved. _has_changed() / has_changed() may come in handy in your case. https://docs.djang

problem with using suds and sharepoint

2014-12-19 Thread Hossein Rashnoo
I tried to add attachment to a sharepoint document library with this command: result = client.service.AddAttachment("new doc","2","ab.ds","QUJDREVGR0hJSktMTU5PUA==") but i got this error: DEBUG:suds.client:sending to (http://portal:8080/rashno/_vti_bin/lists.asmx) message: http://schemas.xmls

Re: problem with using suds and sharepoint

2014-12-19 Thread James Schneider
Based on this: http://schemas.microsoft.com/sharepoint/soap/>schemas.microsoft.com /sharepoint/soap/ ">Item does not exist. It may have been deleted by another user. I'm guessing that listItemID number 2