Re: Model Objects and Updating db via XML

2014-05-13 Thread Avraham Serour
Fixtures are usually in json. Not sure if the is support for importing fixtures in XML In any case you can always parse them yourself and create the proper objects Don't forget that this is an open source project, you can code XML support and contribute On May 13, 2014 10:40 PM, "Sayth Renshaw" w

Model Objects and Updating db via XML

2014-05-13 Thread Sayth Renshaw
Do I need to provide more information or clarity, or is this a harder question than I imagined and I just need to wait for a guru to come through? Sayth -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Django Form Question, Last Post Wasn't Formatted Correctly So I Deleted and Made a New One.

2014-05-13 Thread G Z
> > Below is my code. I am trying to generate a customer signup form from the > Customer model in the models.py file. > Below I have created forms.py which is the script that will generate the form data based on what is in the models.py file. Then in views. I call that forms.py file to run and d

Re: Adding Forms with ModelForm and Writing Data

2014-05-13 Thread G Z
> > so I changed my code into 3 parts. If I understood the documentation right > this should create a form based on the Customer model in models.py and > display it on my index.html > *forms.py* from django import forms from .models import Customer class SignUpForm(forms.ModelForm):

Re: Django year month day

2014-05-13 Thread hito koto
Ok now working, thank you! 2014年5月14日水曜日 13時32分11秒 UTC+9 somecallitblues: > > Try instead. > > > On 14 May 2014 13:26, hito koto > wrote: > >> I'm also have the erroes >> >> Exception Type: NoReverseMatch Exception Value: >> >> u'article.views.main year|add' is not a registered namespace >

Adding Forms with ModelForm and Writing Data

2014-05-13 Thread G Z
I'm trying to follow the documentation on using forms to save data tot he database. vmware is my app name. Nothing is showing up on my index page though. I'm not sure why can anyone help me the documentation isn't clear it bounces everywhere between two different methods without really defining

Re: Django year month day

2014-05-13 Thread Mario Gudelj
Try instead. On 14 May 2014 13:26, hito koto wrote: > I'm also have the erroes > > Exception Type: NoReverseMatch Exception Value: > > u'article.views.main year|add' is not a registered namespace > > > > > 2014年5月14日水曜日 12時19分06秒 UTC+9 hito koto: > >> Hello, >> >> this time i have this the er

Re: Django year month day

2014-05-13 Thread hito koto
I'm also have the erroes Exception Type: NoReverseMatch Exception Value: u'article.views.main year|add' is not a registered namespace 2014年5月14日水曜日 12時19分06秒 UTC+9 hito koto: > > Hello, > > this time i have this the erroes: Please help me; > > Exception Type: NoReverseMatch Exception Val

Django year month day

2014-05-13 Thread hito koto
Hello, this time i have this the erroes: Please help me; Exception Type: NoReverseMatch Exception Value: Reverse for 'article.views.month year month 'prev'' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] this is my the urls.py; url(r"^month/(?P\d+)/(?

Re: Django case, when, then on querysets

2014-05-13 Thread Anthony
Thanks for the answer! Do you think it would be practical to let the orm generate the base query and then doing a replace on the column name? I was thinking of this approach as a custom manager method to return a raw result. This would allow me the generate a case statement for the column and I co

Re: Django case, when, then on querysets

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 11:04 PM, Anthony wrote: > Basically when a queryset like > instance.annotate(totals=Count('item_description')[:3] like > PC 10 > Mac 7 > Mouse 5 > Keyboard 4 > > I want to combine PC and Mac as say: Desktop so the results become > > Desktop 17 > Mac 7 > Mouse 5 > Keyboard

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-13 Thread Guillem Liarte
Tim, Yes! I see now what I was doing wrong; I was setting the path in the Django settings.py (as I had found in the documentation), however, OF COURSE, that is irrelevant because it could ever get there before mod_wsgi being aware of where to look for libraries. Damn! I was having the right i

Re: Django case, when, then on querysets

2014-05-13 Thread Anthony
Basically when a queryset like instance.annotate(totals=Count('item_description')[:3] like PC 10 Mac 7 Mouse 5 Keyboard 4 I want to combine PC and Mac as say: Desktop so the results become Desktop 17 Mac 7 Mouse 5 Keyboard 4 Scanner 3 Ant On 14/05/2014 4:45 AM, "Tom Evans" wrote: > On Tue, May

What naming convention do u prefer for STATIC_ROOT dir?

2014-05-13 Thread 77cc33
What is your naming convention do u prefer for static_root dir? assets collected_static static_root or some other? -- 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

Re: Django case, when, then on querysets

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 1:00 AM, Anthony Hawkes wrote: > Hi Guys, > > I need to replace results in a queryset and then perform counts and further > queries on the set and have been trying to find a way of doing it. What do you mean by "replace results"? > > Basically in some but not all cases I

Model Objects and Updating db via XML

2014-05-13 Thread Sayth Renshaw
Can I ask for some assistance please. For my project I will need to upate the database from an external xml file consistently. The xml is like this one http://old.racingnsw.com.au/Site/_content/racebooks/20140515GOSF0.xml If i have create my model objects, most of which will have a direct corre

Re: Polymorphic Inheritance

2014-05-13 Thread Brian Schott
A good package for what you describe is: https://github.com/chrisglass/django_polymorphic http://django-polymorphic.readthedocs.org/en/latest/performance.html At best this is performing one query per table. This is better than the hand-built solutions which often perform multiple queries per row.

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 6:44 PM, Aseem Bansal wrote: > Thanks for the explanation Tom. Really appreciate that. Your explanation is > very clear. My question's focus is not. From the beginning I have focused on > CSRF which might have taken the focus away from the real problem at hand. > > The prob

Polymorphic Inheritance

2014-05-13 Thread guettli
I search for a way to get polymorphic inheritance like in "Single table inheritance" [1] I have found this comparison site: https://www.djangopackages.com/grids/g/model-inheritance/ Before I try each, I want to ask here, if someone answer some questions: I have three classes: Parent, ChildA

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Aseem Bansal
Thanks for the explanation Tom. Really appreciate that. Your explanation is very clear. My question's focus is not. From the beginning I have focused on CSRF which might have taken the focus away from the real problem at hand. The problem is that data needs to be passed from the browser's curr

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 6:14 PM, Aseem Bansal wrote: > I understand that it would leave the view open to CSRF attack. That is the > reason why I asked about "Also when you are doing Django projects and need > to deal with JS then what do you do? I mean is there an alternative for JS > in Django? "

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Aseem Bansal
Also couldn't it be like a webservice? I mean in Django I create a view which would require some authentication and the JS can ask for passwords? Is there something I am completely missing in here? Just floating an idea becuase turning off security doesn't seem like a good design. The options l

Re: turn off csrf

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 4:36 PM, hinnack wrote: > > Am Dienstag, 13. Mai 2014 16:48:57 UTC+2 schrieb Tom Evans: >> >> On Tue, May 13, 2014 at 2:49 PM, hinnack wrote: >> > Hi, >> > >> > how can I turn off csrf completely - even in the admin interface? >> > >> > My base problem is, that with IE11 (

Re: Opinion needed for a BookMarker project - Regarding CSRF token

2014-05-13 Thread Aseem Bansal
I understand that it would leave the view open to CSRF attack. That is the reason why I asked about "Also when you are doing Django projects and need to deal with JS then what do you do? I mean is there an alternative for JS in Django? ". I mean that whether there is a way to properly integrate

Re: turn off csrf

2014-05-13 Thread hinnack
Am Dienstag, 13. Mai 2014 16:48:57 UTC+2 schrieb Tom Evans: > > On Tue, May 13, 2014 at 2:49 PM, hinnack > > wrote: > > Hi, > > > > how can I turn off csrf completely - even in the admin interface? > > > > My base problem is, that with IE11 (and only IE11) I can not save any > form > > in

multi org and user site

2014-05-13 Thread Anil Jangity
I would like to create a web site that will have multiple organizations with it's own set of user accounts. Something like a "reseller" account. e.g. Org1 user1, user2, user3 Org2 user1, userA, userB Each Org would have it's own billing, user info. Does anyone have any sample demo code tha

Re: turn off csrf

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 2:49 PM, hinnack wrote: > Hi, > > how can I turn off csrf completely - even in the admin interface? > > My base problem is, that with IE11 (and only IE11) I can not save any form > in the admin interface. I always get: > > CSRF verification failed. Request aborted That mes

turn off csrf

2014-05-13 Thread hinnack
Hi, how can I turn off csrf completely - even in the admin interface? My base problem is, that with IE11 (and only IE11) I can not save any form in the admin interface. I always get: CSRF verification failed. Request aborted I have no csrf middleware set. What else must be done? (using django

Re: How to localize database fields

2014-05-13 Thread Tom Evans
On Tue, May 13, 2014 at 1:23 PM, alghafli wrote: > Hello django users. I am new to django and a bit new to databases. This is > actually my first time making a web and database project. > What I want to do is to localize database field names so that the field name > appears differently in the admi

How to localize database fields

2014-05-13 Thread alghafli
Hello django users. I am new to django and a bit new to databases. This is actually my first time making a web and database project. What I want to do is to localize database field names so that the field name appears differently in the admin and user sites depending on the language chosen. fo

Re: After posting an ajax login form successfully, randomly user is still anonymous

2014-05-13 Thread PyMan
Anyone? -- 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-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups

Re: Django1.6 CentOS Apache static

2014-05-13 Thread hito koto
Ok, Thank you! 2014年5月13日火曜日 17時28分07秒 UTC+9 Christian Ullrich: > > * hito koto wrote: > > > I have the following error: > > [Tue May 13 14:43:47 2014] [warn] The Alias directive in > > /etc/httpd/conf.d/wsgi.conf at line 17 will probably never match because > > it overlaps an earlier Alias.

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-13 Thread Timothy W. Cook
I am not sure where your problem is with locale. Did you ever accomplish recompiling mod_wsgi for Python 3.3? This site http://www.ccdgen.com is Django 1.6, Python 3.3 and Apache 2.2 on CentOS 6.5 I recompiled mod_wsgi as per instructions I found somewhere on the WWW. Sorry I do not have the li

Re: Problems Sending Email From Django SIte

2014-05-13 Thread markmnl
Exact same problems, thanks. Of all the things I love about Python that one has caught me out a few times. On Sunday, February 2, 2014 8:15:43 AM UTC+8, Matt Schinckel wrote: > > Your ADMINS setting is incorrect. > > In python, the value ((a,b)) is not a 1-tuple containing a 2-tuple, as you > wa

problem in translation

2014-05-13 Thread Emanuel
Hello! I have a template with two block trans. the template code: {% extends "a.html" %} {% load i18n %} {% block pageTitle %} {% trans "MyTitle" %} {% endblock %} {% block short_description %} {% blocktrans %} My short description {% endblocktrans %} {% endblock short_desc

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-13 Thread Guillem Liarte
Has anybody being able to solve this problem with the locale in virtual env? I am stuck with it for the moment. It is just that Centos 6 + Django 1.7 (python3.x ) is a no-go? Thanks. On Wednesday, 7 May 2014 16:33:23 UTC+2, Guillem Liarte wrote: > > Timothy, > > Thanks you, but SELinux here doe

Re: Django1.6 CentOS Apache static

2014-05-13 Thread Christian Ullrich
* hito koto wrote: I have the following error: [Tue May 13 14:43:47 2014] [warn] The Alias directive in /etc/httpd/conf.d/wsgi.conf at line 17 will probably never match because it overlaps an earlier Alias. This is my the : /etc/httpd/conf.d/wsgi.conf Alias /static/ "/django_test/skillshar

Django RequestFactory() secure not working

2014-05-13 Thread jvc26
Could anyone explain what is going wrong here: factory = RequestFactory() factory.post('/', secure=True).is_secure() Surely that should be True? J -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receivi

Re: List Filter Age range

2014-05-13 Thread Venkatraman S
# django-filters does awsum stuff with filtering. # create a form with 2 date fields and then use it as an input in your filtering function(in the view) On Sun, May 11, 2014 at 6:39 PM, Anderson wrote: > Hi there. > > I'm having a problem with filter a model by age range, is a DateField but >

Re: html email function to a large recipient list problem

2014-05-13 Thread Venkatraman S
I havent looked at your entire problem statement , but https://github.com/pinax/django-mailer does give you many features w.r.t emails OOB. On Mon, May 12, 2014 at 3:49 PM, MikeKJ wrote: > Anyone have an insight into this please? > > -- > You received this message because you are subscribed to

Re: displaying album title for appropriate image (ForiegnKey)

2014-05-13 Thread Venkatraman S
# You have a FK from Image to Album and hence there will only be only 1 Album for every image as per your design # Have a look at django-photologue for some code-inspiration. -Venkat On Mon, May 12, 2014 at 10:47 AM, bradford li wrote: > I am trying to display the album titles related to my i

IE sends wrong CSRF cookie

2014-05-13 Thread Christian Ullrich
Hello all, I have a strange problem with a POST form submission from IE. Apparently, the browser spontaneously starts sending a different CSRF cookie with the POST request: -> GET /form/ <- 200, Set-Cookie: csrftoken=abcd -> GET /some/resource, Cookie: csrftoken=abcd <- 200 -> GET /some/other