Re: How to add fields to an existing model dynamically? Also how to modify existing field of a model dynamically?

2015-07-30 Thread SriPrad
Hi, Thanks for the quick response. I understand that it is not typical to have dynamic model. However the requirements I have need to allow the admin to make changes/ create models dynamically. I have looked at South library. However my understanding is that it is not supported for Django 1.7

Re: how to deploy django 1.8 on openshift

2015-07-30 Thread Gpzim Pacheco
This tuto is great. https://github.com/Gpzim98/Django-OpenShift-1.8 > > -- 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

Re: Restricting CreateView

2015-07-30 Thread James Schneider
get_queryset() is designed to filter down a list of of available objects that a generic view can use. The reason that CreateView doesn't have one is because the purpose of CreateView is to create a new object to operate on (meaning that there shouldn't be anything in the database that can be

Introduction to Pulpo-Forms

2015-07-30 Thread Luciano Ferrari
Last April we finished the development of a dynamic form builder, called pulpo-forms, to use within a Django Project. Today we’re excited to announce that we’re making the source code available on GitHub . Here is a short list with the most

Re: Does imports of related models affect cascade deletion?

2015-07-30 Thread Markus Amalthea Magnuson
I will fetch the actual piece of code and build a small test case out of it, will reply again in this thread when I have some more info. On Thu, Jul 30, 2015 at 6:39 PM, Marc Aymerich wrote: > On Thu, Jul 30, 2015 at 3:38 PM, Markus Amalthea Magnuson >

Re. My Django Book.

2015-07-30 Thread Steve Burrus
* Say I was wondering if anyone else has ever read this particulkar Django book called "Sams Teach Yourself Django in 24 Hours" I checked out of the library yesterday? [yeah I know it's one of the "24 hours" series] Does it really teach the beginner a lot of things concerning Django?* --

Custom Field

2015-07-30 Thread Aurélio Moreira
I wanted your help to make a custom Field Type'm studying it at the time and I'm not getting. I'll put it to you here the code I've done so far. I hope your help. http://pastebin.com/81Lq86Xn Field http://pastebin.com/CvATavnd Widget http://pastebin.com/2tNcKtgfForm -- You received this

Re: Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread Rich Lewis
Hi Tom, That was approximately what I was planning to do, I shall do some experimenting to see if I can do any more. I was just wondering if there was a clever feature for this sort of thing, as ORMs seem pretty magic already! Thanks, Rich On Thursday, 30 July 2015 17:15:40 UTC+1, Tom Evans

Re: Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread Rich Lewis
Oops sorry I meant every B instance can have multiple A instances. Sorry! On Thursday, 30 July 2015 16:21:37 UTC+1, monoBOT monoBOT wrote: > > > 2015-07-30 16:08 GMT+01:00 Rich Lewis : > >> There are precisely 2 B instances associated with each A instance. Each >> A

Re: Does imports of related models affect cascade deletion?

2015-07-30 Thread Marc Aymerich
On Thu, Jul 30, 2015 at 3:38 PM, Markus Amalthea Magnuson wrote: > Hey, > > I stumbled upon a piece of code and a comment that says this: > > Deleting a model object that has related objects will only cascade delete > those objects if their models have been imported. >

Re: Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread 'Tom Evans' via Django users
On Thu, Jul 30, 2015 at 4:08 PM, Rich Lewis wrote: > Dear All, > > I'm new to the Django ORM, and quite new to ORMs in general. I have two > models (lets call them A and B) between which I have an interesting mapping. > There are precisely 2 B instances associated with each

Re: Testing related models without saving

2015-07-30 Thread Michael Herrmann
I'm very relieved - thanks Tim! If I can help, please let me know. Best, Michael On 30 July 2015 at 17:56, Tim Graham wrote: > We are working on that solution: > https://github.com/django/django/pull/5060 > > > On Thursday, July 30, 2015 at 7:19:31 AM UTC-4,

Re: Testing related models without saving

2015-07-30 Thread Tim Graham
We are working on that solution: https://github.com/django/django/pull/5060 On Thursday, July 30, 2015 at 7:19:31 AM UTC-4, mic...@herrmann.io wrote: > > Hi all, > > I've just been bitten by this new "feature" as well. I completely don't > understand this design decision of 1.8. It is very

Re: Does imports of related models affect cascade deletion?

2015-07-30 Thread Tim Graham
No, import of related models shouldn't affect cascade deletion. Please open a bug report with steps to reproduce if that's actually the case. Possibly it could be a bug that's fixed by the app loading refactor in 1.7. On Thursday, July 30, 2015 at 9:38:09 AM UTC-4, Markus Amalthea Magnuson

Re: How to save data from form FileField to DB Django

2015-07-30 Thread Javier Guerra Giraldez
On Thu, Jul 30, 2015 at 10:40 AM, user07285 wrote: > I have a model and have added a Form FileField to take a file and save all > their contents for a particular object. The FileField doesn't need to be in > the database hence not added as a model.fileField. The content from

How to save data from form FileField to DB Django

2015-07-30 Thread user07285
I have a model and have added a Form FileField to take a file and save all their contents for a particular object. The FileField doesn't need to be in the database hence not added as a model.fileField. The content from the file should be read , parsed and added to the synonym_type.

Re: Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread monoBOT
2015-07-30 16:08 GMT+01:00 Rich Lewis : > There are precisely 2 B instances associated with each A instance. Each A > instance can have many B instances Isnt that a contradiction? -- *monoBOT* Visite mi sitio(Visit my site): monobotsoft.es/blog/ -- You received this

Two-to-Many Mapping between Models in Django ORM

2015-07-30 Thread Rich Lewis
Dear All, I'm new to the Django ORM, and quite new to ORMs in general. I have two models (lets call them A and B) between which I have an interesting mapping. There are precisely 2 B instances associated with each A instance. Each A instance can have many B instances. The order of Bs are

Does imports of related models affect cascade deletion?

2015-07-30 Thread Markus Amalthea Magnuson
Hey, I stumbled upon a piece of code and a comment that says this: Deleting a model object that has related objects will only cascade delete those objects if their models have been imported. Is this true? I have not found it in the documentation and would like to add a reference to the code

Re: How to add fields to an existing model dynamically? Also how to modify existing field of a model dynamically?

2015-07-30 Thread Rafael E. Ferrero
IMHO (maybe i'm wrong) i think that its not quite good modify your database structure dynamically to often, maybe you must to think a better design of your model. I'm working on a Health bussiness in Argentina and never need to change the database structure to modify a medical form. (for now)

Re: Testing related models without saving

2015-07-30 Thread michael
Hi all, I've just been bitten by this new "feature" as well. I completely don't understand this design decision of 1.8. It is very useful to be able to create model classes without having to save them to the database, not just for unit tests but also for experimenting in the shell. The new

How to add fields to an existing model dynamically? Also how to modify existing field of a model dynamically?

2015-07-30 Thread SriPrad
Hi, I am new to Django and Python!. I am using Django 1.8.3 along with Python 3.2 and using sqlite as the database. I am trying to setup a site using Django wherein the model is created dynamically( For eg: a Medical form) The fields of the form are stored in db and the model created

Restricting CreateView

2015-07-30 Thread David
Hi Using other CBV's I can use get_queryset to filter out users that don't belong to a certain group. AFAIK createview doesn't have get_queryset. Can I achieve this with CreateView somehow? The context is: All forums: have to be a member of X to view anything A particular Forum: have to be a

Models.clean() how to raise ValidationError WITH error_code and show field_based errors in the Form-Template?

2015-07-30 Thread ThomasTheDjangoFan
Hi guys, I got a working model.clean() method that actually does a great job showing the errors in the assigned html-form. *The view actually marks single invalid fields red, which I find really important*. *BUT:* Now I want to *write a test* for that model and would love to *test for

Re: Learning Django problems

2015-07-30 Thread Stas soroka
The code for this application is in my GitHub repository, link to witch i provided at the end of my original post. Look carefully ;) среда, 29 июля 2015 г., 14:21:01 UTC+3 пользователь roshan.pannase написал: > > sir i am a new learner can you send me the code of this application > > On Wed,

Re: Learning Django problems

2015-07-30 Thread Stas soroka
As it turned out - the problem was in misconfigured STATICFILES_DIRS variable. When i fixied it - everything became as it should be среда, 29 июля 2015 г., 14:53:04 UTC+3 пользователь Robin Lery написал: > > Do u have static directory? And does it have the required resources? > On 29 Jul 2015

Re: Want to change template based on full_name(request.user.username)

2015-07-30 Thread sarfaraz ahmed
Thanks, this worked like awesome..!!! On Thu, Jul 30, 2015 at 3:06 AM, Alex Heyden wrote: > {{user}} is implicitly sent in the request, so it might be worth trying to > sort out what specifically went wrong when you say > {{user.is_authenticated}} went wrong. > >