Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Hello Again, I don't mean to take advantage of your kindness and generosity in helping me- I'm so appreciativeI'm just still stuck on the ValidationError [u'ManagementForm data is missing or has been tampered with'] Error during template rendering In template /Users/stephani/git/data/data/d

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

2015-03-30 Thread Simon Charette
You're welcome Rolf. Your question lead an initiative by Tim to clarify Jinja2 needs to be installed . Cheers, Simon Le lundi 30 mars 2015 19:47:46 UTC-4, Rolf Brudeseth a écrit : > > >> >> Django 1.8+ adds built-in support but doesn't ship with Jinja

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Lachlan Musicman
likewise. likewise. -- It is through this shadowy emptiness (of negative space) that we walk, talk, see, and live; negative space is the impossible cellophane layer that drapes the known world and is invisible to all but to the most perceptive minds. It is possible to learn to see negative sp

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
I fought with formsets for a week when I started. Glad I could pay it forward a bit. On Mar 30, 2015 10:46 PM, "Stephanie Socias" wrote: > Ah finally! > I had jquery.formset.js in my base.html header. I moved it to my {% > block footer_js %} and it worked!! Not sure why that's the > case

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Ah finally! I had jquery.formset.js in my base.html header. I moved it to my {% block footer_js %} and it worked!! Not sure why that's the caseanyways, now on to the next issue ([u'ManagementForm data is missing or has been tampered with']) but I think I can hopefully fix that one! Th

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Lachlan Musicman
Just checking you have {% load staticfiles %} in your templates - you will need in both iirc? -- It is through this shadowy emptiness (of negative space) that we walk, talk, see, and live; negative space is the impossible cellophane layer that drapes the known world and is invisible to all bu

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
Sounds like a stupid question, but are you 100% sure that this is resolving correctly? You can check by monitoring the network tab when you go to inspect element in a chrome browser (or whatever the firefox equivalent is). When you refresh the page, it will tell you if that file is found or not.

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Sorry to ask here again but I still can't get the imports right for some reason. I get the error: TypeError: $(...).formset is not a function $('.authorFormset').formset({ I have this in the head of my base.html: https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js";>

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
You could have an import error somewhere/somehow with the jquery.formset.js file. Also, you might need to import the jquery library in your application (I import mine in my base template, so that might be why I forgot about it). On Mon, Mar 30, 2015 at 8:33 PM, Stephanie Socias wrote: > Thank y

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Thank you, Bill! I'm getting a TypeError that $(...).formset is not a function I'll see what's up! On Mon, Mar 30, 2015 at 8:29 PM, Bill Blanchard wrote: > Hi Stephanie, > You have two jQuery selectors in your formset function and I'm not sure if > that will cause an issue or not. Also, I don't

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
hmmm still not showing updo I need to add an actual button holder somewhere? I think the js takes care of that but I don't see any links On Mon, Mar 30, 2015 at 8:24 PM, Lachlan Musicman wrote: > I think here: > > > {% for form in formset.forms %} > > > you need to move

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
Hi Stephanie, You have two jQuery selectors in your formset function and I'm not sure if that will cause an issue or not. Also, I don't think you need to use an id in the div tag (that was probably left over from when I was bashing my head against this). Try naming the outer div class something n

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Lachlan Musicman
I think here: {% for form in formset.forms %} you need to move the id {% for form in formset.forms %} cheers L. -- It is through this shadowy emptiness (of negative space) that we walk, talk, see, and live; negative space is the impossible cellop

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Thank you, Bill. That was silly of me. I'm just confused on where/how those actual links are displayed. I can't get them to show... {% load crispy_forms_tags %} $(function() { $('#authorFormset .formset').formset({ prefix: '{{ formset.prefix }}', addText: 'A

Re: Django Http post and csrf error

2015-03-30 Thread Vijay Khemlani
To prevent the CSRF validation you can use the csrf_exempt decorator https://docs.djangoproject.com/en/1.7/ref/contrib/csrf/#utilities The normal way to handle a POST request is to issue a redirect (HTTP 302) after handling the request, but if it is an automated request I guess you can return an

Re: Jinja2 with Django 1.8c1 & cannot import name 'Environment'

2015-03-30 Thread Rolf Brudeseth
> > > > Django 1.8+ adds built-in support but doesn't ship with Jinja2, the same > way it has built-in support for PostgreSQL but doesn't ship the psycopg2 > package. > > You must install it in your environment just like you did with the Django > package. > > Thanks Simon. Installing Jinja2 fix

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
I am moved to say thank you to all the devs from day 1 for Django. It is a marvellous piece of work. All of it. Thanks Mike On 30/03/2015 6:53 PM, Mike Dewhirst wrote: On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23

subprocess behave diferent in the server than in the client.

2015-03-30 Thread dk
hi, I have a button in my webpage that lunch a subprocess and check the ping of the computer and save the information in a text file. that's it, very basic stuff. If I am doing my click in the server computer everything works, the subprocess will ping the computer, make the file and save the

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
Hi Stephanie, The addText and deleteText variables are the hyperlink text that is displayed on the page. You can remove them or modify accordingly. I believe the default values are Add Form and Remove Form if you do not explicitly declare them in the javascript function. On Mar 30, 2015 6:03 PM, "

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Thank you all SO much for your advice. Even just hearing that this is a complicated problem and that it's not just me, really helps. I will post my code shortly. I'm now trying to incorporate some of your feedback. Bill, How do I set/use the 'addText' and 'deleteText' variables from the script in

Regarding validators (user defined)

2015-03-30 Thread djangousernew
Hi, I've two queries related to validators, would appreciate if someone could reply. (1) As part of my application, I'm planning to add new validators. Is there any documentation on best practices of doing the same? I've been looking into https://docs.djangoproject.com/en/1.7/_modules/djang

Django Http post and csrf error

2015-03-30 Thread Tanmay Kansara
I am trying to do the following: 1) A payment solution is supposed to send an HTTP Post to my site 2) I would like to read the contents of the request(xml) and update my records to reflect the payment I am trying this for the first time. When I create a URL path, and send a post to that addr

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Lachlan Musicman
Carl is right - this is a hard problem. I'm a mid level django developer and I spent at least a week trying a number of solutions (and doing the other, non Django, parts of my job). The one that ended up working for me was the django-dynamic-formset javascript library. https://github.com/elo80ka/

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Bill Blanchard
Hi Stephanie, I've had success with the following jQuery library: https://github.com/elo80ka/django-dynamic-formset You can administer the formsets normally in your view and forms files. Reference here: https://docs.djangoproject.com/en/1.7/topics/forms/formsets/ Here is a code snippet of a temp

Re: Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Carl Meyer
Hi Stephanie, On 03/30/2015 02:37 PM, Stephanie Socias wrote: > I'm having trouble creating a formset where I can dynamically add and > delete items. I've tried many different approaches and can't get > anything to work. I'm new to Django and have been at this for days. Can > someone please help m

Help with Dynamically Adding Forms to Formset!!

2015-03-30 Thread Stephanie Socias
Hello, I'm having trouble creating a formset where I can dynamically add and delete items. I've tried many different approaches and can't get anything to work. I'm new to Django and have been at this for days. Can someone please help me!? I can send my code, post it, or do a screen share. Pleas

Re: Multiple Django Forms

2015-03-30 Thread Stephanie Socias
Thank you for your suggestions! Unfortunately, as I am very green at the moment, I nee more help to implement all of these new techniques. Given that what I'm trying to accomplish requires more extensive Django and javascript knowledge, is there anyone who would be willing to do a video scr

Solved: sidebar menu appears with every click on the main menu item before it disappears

2015-03-30 Thread Behee Trimble
To Whom It May be Helpful: This program was using bigSlide.js library that works like a charm and good to inject sidebar menu. The original developer forgot to apply the css lines. Below are the relevant parts: html file: MENU    ... {% block quicknav %}{% endblock %}

Re: Enterprise software patterns for django/Python ?

2015-03-30 Thread Ilya Kazakevich
Hello. Django is full-stack *web* framework, so it has some web-specific shortcuts, and probably does not fit ideally in enterprise patterns. For example, it does not encourage you to have "backend server" and "frontend server" connected via SOAP/XML/ESB like in "classical" enterprise approach

Re: Enterprise software patterns for django/Python ?

2015-03-30 Thread Avraham Serour
start with the django tutorial On Mon, Mar 30, 2015 at 8:21 AM, Jeff Mangan wrote: > Looking for info or links on design patterns and architecture references > on building a web portal using Python and Django. Looking for things like > how to model your solutions, layers, services, data and busi

Re: FK relations hell : help with `_set` feature

2015-03-30 Thread François GUÉRIN
Le lundi 30 mars 2015 14:31:19 UTC+2, Daniel Roseman a écrit : > > > On Monday, 30 March 2015 13:04:00 UTC+1, François GUÉRIN wrote: >> >> Hi all, >> >> I'm using django for a couple of years, and I've a question about >> relations in the ORM and templates. I massively use class-based generic

Re: FK relations hell : help with `_set` feature

2015-03-30 Thread Daniel Roseman
On Monday, 30 March 2015 13:04:00 UTC+1, François GUÉRIN wrote: > > Hi all, > > I'm using django for a couple of years, and I've a question about > relations in the ORM and templates. I massively use class-based generic > views. > > I' currently working with a model which have many other models

FK relations hell : help with `_set` feature

2015-03-30 Thread François GUÉRIN
Hi all, I'm using django for a couple of years, and I've a question about relations in the ORM and templates. I massively use class-based generic views. I' currently working with a model which have many other models FKing to it : class People(models.Model): last_name = models.CharField(

Re: Multiple Django Forms

2015-03-30 Thread François GUÉRIN
1/ use generic views : ProcessFormView by example 2/ use prefixes in your forms with there name (it's a param in form cctor) 3/ in your template, use the {%for form in forms %}{% form.as_p %}{%endfor %} if you put your forms into a list form forms Good coding ! -- You received this message b

Re: Textarea taking htnml tags

2015-03-30 Thread Akash Patni
hi for removing html tags i have used the following function but it is not working...Please suggest class NotesForm(forms.Form): ''' Notes ''' note_title=forms.CharField(label="Note Title *:",max_length=100) note=forms.CharField(widget=forms.Textarea,label="Note:",required=False) d

Enterprise software patterns for django/Python ?

2015-03-30 Thread Jeff Mangan
Looking for info or links on design patterns and architecture references on building a web portal using Python and Django. Looking for things like how to model your solutions, layers, services, data and business logic, to promote scale, security, and performance. I have a Microsoft background an

Multiple Django Forms

2015-03-30 Thread Stephanie Socias
Hello, I've been trying for days to get my form(s) going. I essentially have four separate forms and a formset that I am trying to submit with one submit button. I'm using django-crispy-forms. My first issue it that now my form "submit" button is not doing anything. Additionally, I need to be a

Re: authenticate() not working

2015-03-30 Thread aRkadeFR
Hello, Just by changing the type of your input, you're enable to authenticate inside your view then? Do a dump of your post data to see if anything has changed. ``` print("data: {!s}".format(request.POST)) ``` Then you can see in a shell (manage.py shell) if the authenticate function works as

Re: How to prevent save/delete in the Admin

2015-03-30 Thread Mike Dewhirst
On 30/03/2015 10:48 AM, Mike Dewhirst wrote: On 30/03/2015 3:11 AM, Melvyn Sopacua wrote: On Sunday 29 March 2015 22:04:23 Mike Dewhirst wrote: snip That said, maybe I'm not getting your workflow correctly, but to me it seems that if request.user is not owner, some fields should be readonly

Re: Multiple Django projects using the same database

2015-03-30 Thread Ien C.
All makes sense, thanks again! --Ien On Sunday, March 29, 2015 at 11:25:41 PM UTC-4, Russell Keith-Magee wrote: > > > On Mon, Mar 30, 2015 at 10:20 AM, Ien C. > > wrote: > >> Thanks Russ! >> >> Good point about the validation logic. Will definitely keep that in mind. >> And yes, my basic approac