Update value in database

2019-12-19 Thread Nuno Vieira
Hi! I have a real estate django app and i have a form to users insert a new property. I also have in the form several images fields that users can use to upload images to database whitout problem. The problem is if the *user want to delete one of the images field.* I have an ajax request that

Re: ElementTree problem saving images

2019-11-07 Thread Nuno Vieira
ira, 24 de Outubro de 2019 às 16:28:00 UTC+1, Nuno Vieira escreveu: > > Hi, > > i receive an xml file and i am parsing the values and sving them to > database. > >> XML Example: > > ... > ... > ... > > 9896 > 2019-07-11 13:12:09 > BC30401 > 89500

Re: ElementTree problem saving images

2019-11-06 Thread Nuno Vieira
one on every iteration where the id > doesn't match. Try setting all of the urls to None before the loop, then > remove the else blocks. > > On Thursday, October 24, 2019 at 11:28:00 AM UTC-4, Nuno Vieira wrote: >> >> Hi, >> >> i receive an xml fil

ElementTree problem saving images

2019-10-24 Thread Nuno Vieira
Hi, i receive an xml file and i am parsing the values and sving them to database. > XML Example: ... ... ... 9896 2019-07-11 13:12:09 BC30401 895000 EUR sale 0 0 0 915 Villa 37.134720 -8.020436 optional location detail Vilamoura Algarve Portugal 4 3 1 https://bc-villas.com/wp-content/up

Re: delete image url from database

2019-10-16 Thread Nuno Vieira
update the url in database or to delete. I already tried with update Listing.objects.all().filter(id = 1511).update(photo_5 = None) It seems that i can not change the value of photo_5. quarta-feira, 16 de Outubro de 2019 às 15:23:07 UTC+1, Nuno Vieira escreveu: > > Hi there, > >

delete image url from database

2019-10-16 Thread Nuno Vieira
Hi there, i am creating a real estate app and i want users to insert and delete images for the houses. It's all working great except the delete. In my views.py i have the code: listing = Listing.objects.get(id=1511) if listing: listing.photo_5 = None

Re: parse xml from url to database

2019-06-13 Thread Nuno Vieira
, 13 de Junho de 2019 às 00:04:33 UTC+1, Ewen Le Bihan escreveu: > > Hi, where does prof.xml_ky comes from ? > > Le mercredi 12 juin 2019 18:22:01 UTC+2, Nuno Vieira a écrit : >> >> Hi there. >> >> I´m having some problems on parsing a real estate xml to database

Re: parse xml from url to database

2019-06-13 Thread Nuno Vieira
quarta-feira, 12 de Junho de 2019 às 17:22:01 UTC+1, Nuno Vieira escreveu: > > Hi there. > > I´m having some problems on parsing a real estate xml to database. > The user profile have url field to import properties automatically from > xml feed (url). The user can i

parse xml from url to database

2019-06-12 Thread Nuno Vieira
Hi there. I´m having some problems on parsing a real estate xml to database. The user profile have url field to import properties automatically from xml feed (url). The user can insert mannually or automatically, if the user insert the url feed then it should be able to get the objects and save

API for writing a new database backend

2018-07-18 Thread Nuno
Hi, I'm starting to write a new database backend for a non-relational database, but I can't find any API specification that I should follow. Such API or any related documentation exists? Thank you, Nuno -- You received this message because you are subscribed to the Google Groups &qu

Django traffic control

2013-10-25 Thread Nuno Lopes
Hi guys/girls, I have a project in Django and I want to control the access to an API. Basically just know and register who is using it. I could go to each controller and do this by hand using the api key. But I am hoping that there is a better solution. Do you have some suggestion to give me?

Re: Django Celery FIFO ORDER

2012-12-10 Thread Nuno Khan
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, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this g

Re: django synchronize database over REST

2012-12-06 Thread Nuno Khan
users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > >

ANN: Two-Step Authentication with Django

2012-01-23 Thread Nuno Maltez
django-twostepauth is a Django application that allows user authentication with two steps for additional security. The first step with username and password and the second step with a one-time code such as the codes generated by soft token devices like Google Authenticator. Features: * Authe

Mysql + Unicode + username curiosity

2011-11-14 Thread Nuno Maltez
names are all CharFields, yet username displays this peculiar behaviour. Any reason for this? I'm using: mysqld Ver 5.1.41 Django (1, 3, 1, 'final', 0) MySQLdb (1,2,3,'final',0) In my.conf used in the connection I have [client] default-character-set = utf8 and the ta

Re: filepath (system file system path) field

2010-09-22 Thread Nuno Maltez
est apporach: Creating a custom field perhaps? Or > perhaps extending the filefield? Or maybe just use a charfiled and do > it all in validation? What do you guys think? Hmmm something like this? http://docs.djangoproject.com/en/dev/ref/models/fields/#filepathfield Nuno -- You received th

Re: RSS Questions

2010-09-20 Thread Nuno Maltez
ntent:encoded" tag? Is that right? How to I get the > RSS feed to generate that? What's wrong with including the post's html in the description field? http://djangogigs.com/feeds/gigs/ hth, Nuno On Fri, Sep 17, 2010 at 6:52 PM, Joel Davis wrote: > Hello, > > I am

Re: Mudar Senha de um usuário

2010-09-17 Thread Nuno Maltez
Hi, If the user is logged in, instead of user = User.objects.get(username=nome) you can use user = request.user See: http://docs.djangoproject.com/en/dev/topics/auth/#authentication-in-web-requests Nuno 2010/9/17 Giovanna Ronzé : > Dado que um usuário está logado e quer mudar sua se

Re: Deply with mod_wsgi

2010-09-16 Thread Nuno Maltez
Well, my guess is that you should change the template responsible for the page in your second picture and fix the tag that displays the graphic so that the source points to /simuladores/grafico/ instead of /grafico/ Nuno On Thu, Sep 16, 2010 at 6:05 PM, Waléria Antunes David wrote: > Yes,

Re: Deply with mod_wsgi

2010-09-16 Thread Nuno Maltez
m, is it writing it to /var/www/django/grafico ? hth, Nuno On Thu, Sep 16, 2010 at 12:30 PM, Waléria Antunes David wrote: > Hi all, > > I need to put my project on the web server. I installed the Python, Django, > mod_wsgi and configured the VirtualHost file: http://pastebin.com/Xe7Sq

Re: problem with block tag and autoescaping

2010-09-16 Thread Nuno Maltez
by "&"? Using & will cause validation errors: http://htmlhelp.com/tools/validator/problems.html#amp Nuno -- 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

Re: I need a middleware to add language to urls in my templates

2010-08-11 Thread Nuno Maltez
I'm not sure if this provides exactly what you need, and I've never tested it with satchmo, but I've been using http://code.google.com/p/django-localeurl/ with success to proved different urls according to the language transparently. Maybe this helps, Nuno On Wed, Aug 11,

Re: problem with a formset from model

2010-08-11 Thread Nuno Maltez
This happens to me as well (also with 1.2.1). Seems like a bug with _queryset vs queryset on BaseModelFormSet. Maybe you could submit a ticket to http://code.djangoproject.com/query Nuno On Tue, Aug 10, 2010 at 9:21 PM, refreegrata wrote: > Hello list. I have a problem. I'm a newbie i

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

2010-08-09 Thread Nuno Maltez
ng or not." Since you're returning nothing, self.cleaned_data['username'] will be None when saving your user hence the "auth_user.username may not be NULL" exception. [1] http://docs.djangoproject.com/en/dev/ref/forms/validation/ hth, Nuno -- You received this message

Re: Unicode challenged

2010-08-09 Thread Nuno Maltez
#x27; marks. Are you sure that you get '?' on the file if you write it this way, or it's just the console/editor that you're using to see the file's contents that cannot handle the text's encoding? I really think write( string_content.encode( '' ))

Re: permalink problem

2010-07-20 Thread Nuno Maltez
Maybe you can get a better description / traceback of the error from the shell. Something like python manage.py shell >> from myapp.models import Post >> p = Post.objects.all()[0] >> p.get_absolute_url() hth, Nuno On Tue, Jul 20, 2010 at 4:46 AM, vcarney wrote: > I'm

Re: Accessing the current user's first name

2010-07-20 Thread Nuno Maltez
this line (I simply didn't understand)? User.get_profile = lambda self: Profile.objects.get_or_create(user=self)[0] Nuno On Tue, Jul 20, 2010 at 4:38 PM, reduxdj wrote: > OK, from my example, the model is called Roommate, so I am not > duplicating any User model data there... So all of

Re: GAE + Django Authentication

2010-07-20 Thread Nuno Maltez
Hi, Have you tried django-nonrel? - http://www.allbuttonspressed.com/projects/django-nonrel On Tue, Jul 20, 2010 at 6:59 AM, Venkatraman S wrote: > Hi, > > Has anyone made inroads into django auth in GAE? I have been Googling around > for sometime and havent found a credible link on this. > Hel

Re: Custom form field validation and required=False

2010-07-16 Thread Nuno Maltez
ised. This method returns the clean data, which is then inserted into the cleaned_data dictionary of the form. """ http://docs.djangoproject.com/en/dev/ref/forms/validation/ hth, Nuno On Fri, Jul 16, 2010 at 2:01 PM, Paddy Joy wrote: > I'm trying to create a cust

Re: Problem with simple search func in template

2010-07-16 Thread Nuno Maltez
t_list', info, name="link-home"), > > ) > > urlpatterns += patterns('web_aplikacje.produkty.views', >   url(r'^search/$', 'search', name="link-search"), > ) > I think your '/search/' url is being caught by your "r'^(?P[-\w]+)/

Re: problem models.py code

2010-07-14 Thread Nuno Maltez
Just set primary_key=True on your field: jono = models.PositiveIntegerField(primary_key=True) See the django documentation for details: http://docs.djangoproject.com/en/dev/topics/db/models/#id1 Nuno On Wed, Jul 14, 2010 at 6:38 PM, Jagdeep Singh Malhi wrote: > I try  this code to cre

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Nuno Maltez
On Wed, Jul 14, 2010 at 3:50 PM, Nuno Maltez wrote: > Sorry, I can't reproduce your error with django 1.2. > > I copied your models (just removed the intermediaty "Permission" > because I don't know your User model) into a new app and I have 2 Oops, forgot

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Nuno Maltez
ion runs just fine b) if I do not select an User, then the "clean" method is still accessed, but since 'users' is not present in the cleaned_data dict it throws an exception - which is the scenario you give, hence my original guess :) Nuno On Wed, Jul 14, 2010 at 2:32 PM, H

Re: Admin Model Validation on ManyToMany Field

2010-07-14 Thread Nuno Maltez
Hi, Just a guess: have you actually selected a user and a folder when submitting the form? I think only valid field are present on the cleaned_data dict, and your users and folder fields are not optional (blank=True, null=True). hth, nuno On Tue, Jul 13, 2010 at 1:45 PM, Heleen wrote: > He

Re: return number instead of string in admin

2010-07-14 Thread Nuno Maltez
Hi, Why not def __unicode__(self): return u"%d" % self.mynumber ? Nuno On Wed, Jul 14, 2010 at 11:15 AM, alan-l wrote: > Hi, > > in the tutorial i see that to return a string or a combination of > strings, i can do: >    def __unicode__(self): >        retur

Re: models.py import from other models.py

2010-07-08 Thread Nuno Maltez
What error do you get when you execute 'manage.py syncDB'? Could you paste it here? Nuno On Thu, Jul 8, 2010 at 2:28 AM, yugori wrote: > Hi, I'm beginner. > > I tried to execute 'manage.py syncDB' command, > but it's not work. -- You received this

Re: Query raises a DoesNotExist error

2010-07-07 Thread Nuno Maltez
uldn't the second FullProfile.objects.get just raise a FullProfile.DoesNotExist eception again? It seems you're just catching an exception in order to throw it again in the except block... hth, Nuno -- You received this message because you are subscribed to the Google Groups "D

Re: Apache config trouble

2010-07-07 Thread Nuno Maltez
Hi, Are you sure the syntax error isn't in the wsgi file itself? /Library/WebServer/testing123/apache/django.wsgi Nuno On Wed, Jul 7, 2010 at 3:02 PM, Bradley Hintze wrote: > Hi all, > > I'm getting the following error n the apache error log: > > [Wed Jul 07 09:53

Re: Several translations for the same string

2010-07-05 Thread Nuno Maltez
#: .\myapp\models.py:87 msgid "is active (f)" msgstr "è attiva" ###en/myapp.po #: .\myapp\models.py:39 msgid "is active (m)" msgstr "is active" #: .\myapp\models.py:87 msgid "is active (f)" msgstr "is active" HTH, Nuno On Mon, Jul 5,

Re: Path issue (TemplateDoesNotExist)

2010-06-02 Thread Nuno Maltez
Well, if you're trying to render a template : "posts/post_list.html", the post_list.html file should live inside "posts" directory inside of your "templates" directory : templates/posts/post_list.html Don't mix html and python files in the same dir.

Re: Problems with Django File Fields

2010-05-31 Thread Nuno Maltez
ew that validates the user's permissions and returns the filepath to mod xsendfile. It's not a perfect solution but it's the best I found so far, at least for my purposes :) Nuno On Mon, May 31, 2010 at 2:06 PM, klaasvanschel...@gmail.com wrote: > Hi All, > > The standa

Re: tinymce hyperlinks

2010-05-31 Thread Nuno Maltez
Maybe related to this issue? http://code.google.com/p/django-grappelli/issues/detail?id=184 It's supposed to be fixed on the latest grappelli release though. Nuno On Mon, May 31, 2010 at 5:13 PM, Bobby Roberts wrote: > the only javascript error i'm ge

Re: ImportError: No module named django.core

2010-05-31 Thread Nuno Maltez
n2.6/dist-packages > /usr/local/lib/python2.6/dist-packages/django/bin/django-admin.py So have you tried adding /usr/local/lib/python2.6/dist-packages/ (directory that holds the django module) to your pythonpath? Nuno -- You received this message because you are subscribed to the Google Group

Re: tinymce hyperlinks

2010-05-31 Thread Nuno Maltez
javascript errors when using the wizard? Nuno On Sun, May 30, 2010 at 9:45 PM, Bobby Roberts wrote: > i'm using django 1.1 with tinymce and the grappelli skins.  we just > realized that the tinymce editor does not let you put hyperlinks in. > if you go into HTML and hand code them they

Re: password reset getting error - 'function' object is not iterable

2010-05-28 Thread Nuno Maltez
At a first glance it looks like a problem with your urls. Could you show us your custom template and url definitions from urls.py? Nuno On Thu, May 27, 2010 at 7:10 PM, Pankaj Singh < singh.pankaj.iitkg...@gmail.com> wrote: > > > > > Exception Value: > > '

Re: mod_wsgi can't find app to import..but I added path to wsgi file?!

2010-05-27 Thread Nuno Maltez
> ImportError: No module named mvc What's the "mvc" module? Python can't seem to find it. Is it in your python path? Nuno On Thu, May 27, 2010 at 4:20 PM, Chris Seberino wrote: > > I fixed the path issue that was causing the spinning but now I'm back &g

Re: Image deduplication and upload_to

2010-05-27 Thread Nuno Maltez
Hi, I think it's designed to do that. See the behaviour of the save/get_available_name methods on core/files/storage.py (in the django source). Maybe you can write your own storage that overrides this (never tried it, but should work). Nuno 2010/5/26 Ricardo Bánffy : > Hi folks. >

Re: Session not working as i had hoped

2010-05-26 Thread Nuno Maltez
et in your session (1st visit) it still returns True. Just replace : if request.session.get('has_visited',True): visited = True else: visited = False with visited = request.session.get('has_visited', False) hth, Nuno -- You received this message because y

Re: ModelForm gives invalid option.

2010-05-26 Thread Nuno Maltez
You simply need to provide a default value for your field, i.e. : turtle_type = models.IntegerField(null=False, blank=False, choices=TURTLE_TYPES, default=1) See the notes on: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#field-types hth, Nuno On Tue, May 25, 2010 at 10:05 PM

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, 201

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. > &g

Re: Custom Model Fields

2010-05-18 Thread Nuno Maltez
Hi, I think what you're trying to accomplish is more or less what django-tagging [http://code.google.com/p/django-tagging/] does, so I suggest looking at its source code. HTH, Nuno On Sun, May 9, 2010 at 11:24 PM, Nick Taylor wrote: > Hi all, > > I want to create my own &quo

Re: override base translations in your project

2010-05-17 Thread Nuno Maltez
I believe it should work the way you describe (you can even remove the line with the reference to the source). Are all the other translations in your project, excepto for those copied from the third party app, working fine? Nuno On Sun, May 16, 2010 at 11:46 PM, lenz wrote: > The Django d

Re: M2M with Intermediary - Django Admin Support - Doesn't appear?

2010-05-14 Thread Nuno Maltez
a way to input the rating as well. Nuno -- 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...@google

Re: Using a variable for a field name in a filter?

2010-05-14 Thread Nuno Maltez
Sure: http://docs.python.org/tutorial/controlflow.html#unpacking-argument-lists myfilter = { var_field: "found" } Foo.objects.filter(**myfilter} hth, Nuno On Fri, May 14, 2010 at 2:19 PM, derek wrote: > Given a model Foo, with a field bar: > Foo.objects.filter(bar = "foun

Re: Taking on a NoneType error

2010-05-12 Thread Nuno Maltez
r.DOB = NULLage >return render_to_response('Government/repsSingle.html', {'entry': > r, 'NULLage': NULLage}) > > The in the template: > > {% if NULLage %} NULLage is never set by your test in the view, seems like it's a constant value, and the if in the

Re: Paginating search results

2010-05-11 Thread Nuno Maltez
Great, Just make sure you don't end up with multiple "page" arguments on your query string when navigating through the results (click next; click next again...). Nuno On Tue, May 11, 2010 at 2:41 PM, Nick wrote: > The POST thing was the result of late night meltdowns and des

Re: Paginating search results

2010-05-11 Thread Nuno Maltez
why are you using POST in the search form?). hth, Nuno On Tue, May 11, 2010 at 1:58 AM, Nick wrote: > I'm trying to paginate results from a search with multiple options. > The only problem is, once I hit the next button it clears the query > and I'm left paginating all the object

Re: Localeurl and django-multilingual

2010-05-10 Thread Nuno Maltez
How are you creating the url for the links? Are you using the {% url %} tag and reverse() functions? It should work, we have sites with localeurl and django-multilingual running fine in production. Nuno On Sat, May 8, 2010 at 12:34 PM, Alessandro Ronchi wrote: > I need to have links w

Re: values() and GenericRelation

2010-05-07 Thread Nuno Maltez
s if it not the > way I said before. > > How can I resolve this? I can't help you on how to use the values method, but can't you just access obj.field1.name to get the name of the related object in field 1 (or obj.field1.id to get its id). HTH, Nuno -- You received this mes

Re: filebrowser issue

2010-05-04 Thread Nuno Maltez
On Mon, May 3, 2010 at 8:10 PM, Bobby Roberts wrote: > hey I have a strange issue.  I was having trouble getting django- > tinymce and filebrowser working.  I've worked through all of the > errors etc.  In filebrowser, I can create a new directory, but when i > try to upload a file or image, nothi

Re: How to filter a query set based on a calculated date value?

2010-05-03 Thread Nuno Maltez
You can try the extra() method and write some SQL: http://docs.djangoproject.com/en/dev/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none Something like (you'd need the correct functions for adding time and finding the current date for you

Re: NoReverseMatch for authentication app views

2010-05-03 Thread Nuno Maltez
Can you access the django login view by typing the URL directly on the browser (http:///login/)? -- 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,

Re: modelForm ordering

2010-04-26 Thread Nuno Maltez
Person.objects.all().order_by("name")) Hope this gives you some pointers in the right direction. Nuno On Tue, Apr 20, 2010 at 3:09 PM, darren wrote: > I am not able to figure out how to order the records that fill the > drop down list in a model form.  On line 112 below, I have atte

Re: Many-To-Many issue; trying to find a way around conditional id

2010-04-26 Thread Nuno Maltez
Are you saying that: collegelist = college.current_objects.filter(collegechoices__school=highschoolid).exclude(name='Undeclared').distinct().annotate(ccount=Count('collegechoices')) gives you the same results as collegelist = college.current_objects.exclude(name='Undeclared').distinct().annota

Re: feed decorator

2010-04-26 Thread Nuno Maltez
Have you tried invoking the pyhton debugger inside _wrapped to find out the actual values of req_format and fmt and what's happening in there? Nuno On Mon, Apr 19, 2010 at 4:15 AM, Streamweaver wrote: > I'm having trouble developing a feed decorator. I feel like the > decora

Re: Problem with RSS feed. (Long Post)

2010-04-21 Thread Nuno Maltez
As you probably have found out by now, since you're using 1.1, just creat the templates feed/_description.html as mentioned in the docs for version 1.1: http://docs.djangoproject.com/en/1.1/ref/contrib/syndication/ On Wed, Apr 14, 2010 at 5:44 PM, Ronnie Betzen wrote: >> Have you tried the obv

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-15 Thread Nuno Maltez
/docs.djangoproject.com/en/dev/ref/forms/fields/#choicefield [2]- http://docs.djangoproject.com/en/dev/ref/forms/fields/#typedchoicefield hth, Nuno On Tue, Apr 13, 2010 at 6:47 PM, geraldcor wrote: > Hello all, > > I know the error "invalid literal for int() with base 10: '&#x

Re: Send file over HTTP

2010-04-15 Thread Nuno Maltez
http://stackoverflow.com/questions/68477/send-file-using-post-from-a-python-script although this is not really a django issue... On Tue, Apr 13, 2010 at 8:59 PM, Rafael Nunes wrote: > How can I send a file over HTTP? -- You received this message because you are subscribed to the Google Groups

Re: another many-to-many filtering question

2010-04-09 Thread Nuno Maltez
Hi, On Wed, Apr 7, 2010 at 9:35 PM, Jim N wrote: > I want to get Questions that a given User has not asked yet.  That > is,  Questions where there is no Asking record for a given User.  I > have the User's id. Well, you can use the exclude() method. In a ManyToMany, the "user" field is like a Us

Re: Problem with RSS feed. (Long Post)

2010-04-09 Thread Nuno Maltez
> Exception Type: ImproperlyConfigured at /feeds/latest/ > Exception Value: Give your Entry class a get_absolute_url() method, or > define an item_link() method in your Feed class. Have you tried the obvious - do what the Exception tells you and add a "get_absolute_url" method to the model of the

Re: Inline for model causes problem during save

2010-04-09 Thread Nuno Maltez
On Thu, Apr 8, 2010 at 7:42 PM, onorua wrote: > I'm using 1.1.1 > On the development server on my laptop - it doesn't happen, on > production - happen every time. > How can I debug why this happen? I have no idea :-P Any other differences between the 2 environments? Database server? -- You rece

Re: Inline for model causes problem during save

2010-04-08 Thread Nuno Maltez
If I understand correctly, you can't create a User without defining a SoldService at the same time? Can't reproduce this behaviour. Which version of Django are you using? Nuno 2010/4/7 onorua : > Hello colleagues, > > I have the models.py: > class User(models

Re: Noticed some strange behaviour of request.GET.get()

2010-04-07 Thread Nuno Maltez
The only difference I can see is that request.GET.get ('subdir') will return an unicode string, u"public_html", instead of a normal string, 'public_html'. If it works with the byte string, try changing the line to subdir_path = str(request.GET.get('subd

Re: Passing hidden foreign key to form as initial value

2010-04-01 Thread Nuno Maltez
I think the form I sent, with ModelChoiceField, will validate with the returned values without any further code. Or am I missing something obvious? On Thu, Apr 1, 2010 at 6:49 PM, phoebebright wrote: > That's one option, the problem is changing the course value returned > from the form into a co

Re: Complex Django query - filtering, joining a many-to-many table

2010-04-01 Thread Nuno Maltez
How about just accessing the "through" models attributes using user__ : filters['user__question_published_date'] see http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships Hht, Nuno On Thu, Apr 1, 2010 at 3:09 PM, Jim N wrot

Re: Passing hidden foreign key to form as initial value

2010-04-01 Thread Nuno Maltez
What about: class CourseBook(ModelForm): course = ModelChoiceField(queryset=Course.objects.all(), widget=HiddenInput()) class Meta: model = CourseBooking and in your view: form = CourseBook(initial = {'course': course.pk}) Nuno On Wed, Mar 31, 2010 at 8:06 PM, ph

Re: raw sql

2010-03-29 Thread Nuno Maltez
wich aren't Teacher. How can I do this? I've tried with Manager.raw() > but it doesn't work or I don't know how to use it I'm not sure I understood what you need, but how about self.fields['man'].queryset=Pupil.objects.filter(gender='M', user__teacher=Non

Re: probleme with delete on cascade with foreign key self-referencing

2010-03-29 Thread Nuno Maltez
Hello, Are you sure you don't have a cyclic reference in there: cat1 -> cat2 -> cat1 ? You can always insert a import pdb; pdb.set_trace() line in the method and use the debugger to figure out what's keeping the loop from exiting normally. Nuno On Mon, Mar 29, 2010 at 2

Re: Initial data in a many to many field

2010-03-25 Thread Nuno Maltez
t least FF has a strange habit of keeping selections when reloading a form, ignoring the initial selected items on the HTML). hth, Nuno -- 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...@g

Re: How verbose model name in admin panel

2010-03-24 Thread Nuno Maltez
I think you need toput verbose_name(_plural) in the class Meta http://docs.djangoproject.com/en/dev/topics/db/models/#id3 class Category(models.Model): class Meta: verbose_name = "Kategoria" verbose_name_plural = "Kategorie" Nuno On Wed, Mar 24, 2010 at 5

Re: Remove session on browser close

2010-03-23 Thread Nuno Maltez
form.thanks = True # delete 'signed_up' from session I'm not sure this meets your needs, but it's a suggestion :) Nuno On Mon, Mar 22, 2010 at 9:40 PM, grimmus wrote: > Basically all i want to do is the following : > > Have a newsletter signup form. When th

Re: Dynamic multi-site - running many sites from one Django instance

2010-03-23 Thread Nuno Maltez
ROOT). This is the method we use in production. Nuno -- 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+unsubs

Re: query a foreignkey

2010-03-19 Thread Nuno Maltez
this: > > 121 122 120 > > House 120 should been excluded from the list though. This still happens with the model suggested by bruno and a filter like: House.objects.exclude(reservations__arrival__range=(Check_arrival, Check_departure)).exclude(reservations__departure__range=(Check_arrival, Ch

Re: An odd issue with loading /media/ files

2010-03-19 Thread Nuno Maltez
Have you checked the logs (or what gets printed to the console in your dev server) to see if what files flash is actually requesting from the server? Any 404s? Nuno On Fri, Mar 19, 2010 at 2:48 PM, Jeffrey Taggarty wrote: > Any ideas? I know the flash loader is working just fine, it&

Re: Using urlencode with the url tag

2010-03-18 Thread Nuno Maltez
have to generate the encoded URL in the view and pass it to > the template? Are you sure it's no applied? urlencode uses python's urllib.quote (http://docs.python.org/library/urllib.html#urllib.quote) and I think it doesn't encode the '/' character by default - maybe that

Optional trailing slash in App URLs

2009-09-28 Thread Nuno Machado
Hello all, I really enjoy the default Django behaviour of handling URL trailing slashes. If one have: (r'^contact', views.contact), It doesn't matter if someone visits mywebsite.com/contact OR mywebsite.com/contact/. It'll work anyway! The problem is when including app urls, for instance: (r'

Recursion without breaking MVC!

2009-09-28 Thread Nuno Machado
Hi djangoers, I've a simple category Model: class Category(models.Model): name = models.CharField(max_length=63) children = models.ManyToManyField('self', symmetrical=False, related_name='parent') I need to create a webpage to display all the categories with proper indentation, somethin

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
> It isn't a bug. Read the docs. Create yourself an empty 404.html and > 500.html file in your templates directory and your flatpage will work > with DEBUG=False. You are so right!! :) It worked like a charm! I neglected this box: "Ensure that your 404 template works Note that the FlatpageFallb

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
Brian Neal <[EMAIL PROTECTED]> wrote: > On Dec 10, 11:48 am, Nuno Machado <[EMAIL PROTECTED]> wrote: > > > > > My urls.py WAS like this: > > > urlpatterns = patterns('', > >     (r'^admin/(.*)', admin.site.root), > >     (r'

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
Thanks a lot, Jeff FW and Dmitry Dzhus. I'm using the most recent release version of Django (installed 5 days ago). 'django.contrib.flatpages' and 'django.contrib.sites' are listed in my INSTALLED_APPS. 'middleware.FlatpageFallbackMiddleware' is in my MIDDLEWARE_CLASSES. My urls.py WAS l

Re: Index page using flatpages

2008-12-10 Thread Nuno Machado
py? > > http://docs.djangoproject.com/en/dev/ref/middleware/#module-django.mi... > > On Dec 9, 7:29 pm, Nuno Machado <[EMAIL PROTECTED]> wrote: > > > Hi, > > > I'm using flatpages to display some static content in a site. The > > "about" pag

Index page using flatpages

2008-12-09 Thread Nuno Machado
Hi, I'm using flatpages to display some static content in a site. The "about" page is working flawlessly (URL = mysite.com/about) but now I'm trying to define the index (URL = mysite.com) using flatpages. I'm having troubles defining the URL in the administration panel: If I put / in the URL fi

Re: IntegrityError on newforms-admin

2008-05-09 Thread Nuno Mariz
Thanks Brian, One more question, there is another way to write a custom validator without override the field type? Nuno On May 9, 5:30 pm, Brian Rosner <[EMAIL PROTECTED]> wrote: > On May 9, 4:31 am, Nuno Mariz <[EMAIL PROTECTED]> wrote: > > > I'm using newforms-ad

IntegrityError on newforms-admin

2008-05-09 Thread Nuno Mariz
I'm using newforms-admin and I've got a "duplicate key violates unique constraint" when I'm added new record(with the same value on field that already exists in the db) in admin interface. I've an "unique=True" in the field, shouldn't admin interface shows a error message in the form and not raise

Re: Locate subset language problem

2007-04-03 Thread Nuno Mariz
Malcolm, A patch that works for me is in: django/utils/translation/ real_trans.py in the function: "def get_language_from_request(request):": for lang, mainlang, order in langs: if lang in supported or mainlang in supported: # If the lang is not supported but mainlang is,

Re: Locate subset language problem

2007-04-03 Thread Nuno Mariz
Sure. On Apr 3, 2:37 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Could you file a ticket about this, please? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Locate subset language problem

2007-04-02 Thread Nuno Mariz
The problem is not when the user do /i18n/setlang/?language=pt-br, but is in the first visit on the site. The language is not selected(i.e. not in the user cookies) and the middleware tries the locale of the user browser and sets it even if the locale is not in the settings.py. Im testing with the

Re: Locate subset language problem

2007-03-30 Thread Nuno Mariz
Hi Malcolm, Simple example: In my settings.py: gettext = lambda s: s LANGUAGES = ( ('pt', gettext('Portuguese')), ('en', gettext('English')), ) Imagine a client accessing to my site with a browser using 'pt-br', my applications falls in 'pt-br'(because of 'django.middleware.locale.Locale

Locate subset language problem

2007-03-30 Thread Nuno Mariz
lambda s: s LANGUAGES = ( ('pt', gettext('Portuguese')), ('en', gettext('English')), ) Any idea to resolve this, or I must do a middleware to fix this? Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message b

  1   2   >