Friday, July 31, 2015

Re: Re. My Django Book.

Since I am grinding my way through the learning process right now I thing I have some fairly pithy comments to contribute. It seems that no two tutorials do things the same way. I got bogged down in Two  Scoops because I needed a more detailed cookbook approach. Tango With Django is the best except it is written for Django 1.7. There is a serious break between how 1.7 and 1.8 handle template files in the settings.py file. I still haven't recovered from this. Initial setup made me pull my hair out by the roots (and I can't afford to loose much more). Some suggestions:
      If your using a database other than the built in SQLite set it up first.
      Setup virtualenv and virtualenvmapper next.
      Do everything else inside of virtualenv.
      Install Django with pip (virtualenv active)
Then start a tutorial. The Django documentations tutorial seemed to be very good until it segued into a long trites on API setup. Really annoying. I just wanted to get the basic system set up. That said, the official tutorial may still be your best bet. Good luck.

Gary R


On Thursday, July 30, 2015 at 1:35:16 PM UTC-7, Steve Burrus wrote:
 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?


   

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5f6624d8-d7f5-47a5-9088-b528b16bbe7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

settings.py TEMPLATES DIRS

Hi

I'm using Django 1.8 and python 2-7 on a Debian Linux system. I am using Ninja-ide as my ide. When I enter the following in the TEMPLATES section the settings.py file I get an invalid syntax error:

'DIRS': [os.path.join(BASE_DIR, 'templates'],


Since the DIRS entry is directly out of a tutorial I'm not sure what the problem implys.


Any help will be sincerely appreciated.


Gary R


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/35d35abb-d5d2-4108-b66e-0456e4324584%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

DB Design question

Hi all!

I have to store spreadsheet info on a db. Some kind of quotes where the user can store distinct prices for every zone. 

After modeling the data, i have a Cell like row. (related to a zone, and with a quantity field).. something like:

zone1  1  100
zone1  2  99
zone1  3  98

Every zone is a fk... The problem is, that data grows quick.. because some quotes can have up to 65 unit fields with 70 to 100 zones.. 

Currently i have a autopk field. but I'm not sure if it will scale.. If i have 5000 users and every users makes 100 quotations.. (7000 rows on the worst case) this is 3500000000.. easy enought to get out of autoincrement fields.. 

I'm thinking on getting rid of the pk field, and use a unique together with (zone_units). do you think this is a good aproach with the orm? I saw that is not possible to make primary key fields ( with grouped fields), but perhaps I can do it with instead of declaring a int field, have a char field storing the 
%s_%s_%s ( quote_id, zone_id, units ) ... 

do you think the last could be a good aproach? 

Sure if i have to shard the data (on the future) I can do it, using this kind of keys.. Data will be queryed by zone.. (For making comparasions of quotes)

I will apreciate any help on the matter.


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/c2a69c66-d1b8-4f08-95ed-b26fbb1d762e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: One-time tasks at varying times with Uwsgi Spooler

On Fri, Jul 31, 2015 at 7:26 PM, thinkwell <thinkwelldesigns@gmail.com> wrote:
> a_long_task.spool({'hello':'world', 'at':timedelta(hours=5))


the 'at' parameter should be _outside_ the callable dictionay, and it
must be the unix timestamp, not a timedelta:

a_long_task.spool({'hello':'world'},
at=(datetime.now()+timedelta(hours=5).timestamp())

--
Javier

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFkDaoRb1atmAYFafHBrPC%2BNYdVO0T%2BY%2Bf5v3tHZ821PVXG5Ow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

BaseListView's get_context_data is missing kwargs?

I created a class FilteredListView(BaseListView, FormMixin) so I can have a filter form in my list view.  The form submits filters via GET.  I have it working.  But there is a piece of the code that I feel ought to be handled by django.  In order to get the form into the context, I duplicated BaseListView.get() and changed the line

    context = self.get_context_data()

to 

    context = self.get_context_data(form=form)

BaseListView's get() accepts a kwargs but it is not used anywhere.  It seems to me that it should be passed to get_context_data() since it accepts a kwargs.  If it did, then I would only need to write a small get() method to instantiate (and optionally bind) the form, then call super with the appropriate kwargs argument to complete the get request processing.

Is there some reason why kwargs is not passed to get_context_data()?

Thanks


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0228628d-d979-47c1-a426-8d08922cabaa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

One-time tasks at varying times with Uwsgi Spooler

I'm using django-uwsgi in my application, but I'm needing to run asynchronous tasks (one-time only) in my django app at varying times, based on user input.


I tried passing in at "at" key to a_long_task.spool({'hello':'world', 'at':timedelta(hours=5)), but that raises a

ValueErrror: spooler callable dictionary must contains only bytes


So I guess that means I can only decorate the task instead of its instantiation. Is there some other suggestion to enable me pass in a variable time param when the spooled tasked should run?


TIA!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2cb64244-2177-42bc-ad56-0a7f8eda8616%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Introduction to Pulpo-Forms

Excellent Fabio!!!

Thanks for the suggestion we will take that into account.

Luciano

El viernes, 31 de julio de 2015, 17:30:07 (UTC-3), Fabio Caritas Barrionuevo da Luz escribió:
interesting, thanks for sharing.

personally, I think that the organization of files on package is somewhat confusing.

said that, you can use a template (skeleton) as a base to create and better organize the package.
I like these two


or more generic to any python package:

https://github.com/ionelmc/cookiecutter-pylibrary

It is quite easy to generate a new project skeleton:

pip install cookiecutter





Em quinta-feira, 30 de julho de 2015 18:46:12 UTC-3, Luciano Ferrari escreveu:

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 important features of this new open source tool:

  • Enable users to create forms with an easy drag&drop UI
  • Angular directives to render the form and the dashboard
  • Multi pages forms.
  • RESTful API
  • Customizable fields validations such as required, length,etc.
  • Conditional enable for fields based on other field values (e.g. in a food preferences survey, hide the 'How do you like your steak?' question to someone that previously answered that's a vegetarian).
  • Conditional enable for form pages based on other field values.
  • Versions and drafts.
  • Integration for Django models.
  • Signals.
  • Configurable actions – show a thank you screen, send an email, etc.
  • Built-in statistics in the dashboard
  • Basic field types answers can be filtered in the dashboard

Since it was made to be flexible from the beginning, this can be extended to add new fields, validations and so on.

We hope you enjoy it, and of coursed we are open to comments, questions and pull requests!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/f5bc7597-8dd7-480c-8db3-3a092368b573%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Introduction to Pulpo-Forms

interesting, thanks for sharing.

personally, I think that the organization of files on package is somewhat confusing.

said that, you can use a template (skeleton) as a base to create and better organize the package.
I like these two

for a django package:

https://github.com/pydanny/cookiecutter-djangopackage

or more generic to any python package:

https://github.com/ionelmc/cookiecutter-pylibrary

It is quite easy to generate a new project skeleton:

pip install cookiecutter

cookiecutter https://github.com/pydanny/cookiecutter-djangopackage

or

cookiecutter https://github.com/ionelmc/cookiecutter-pylibrary



Em quinta-feira, 30 de julho de 2015 18:46:12 UTC-3, Luciano Ferrari escreveu:

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 important features of this new open source tool:

  • Enable users to create forms with an easy drag&drop UI
  • Angular directives to render the form and the dashboard
  • Multi pages forms.
  • RESTful API
  • Customizable fields validations such as required, length,etc.
  • Conditional enable for fields based on other field values (e.g. in a food preferences survey, hide the 'How do you like your steak?' question to someone that previously answered that's a vegetarian).
  • Conditional enable for form pages based on other field values.
  • Versions and drafts.
  • Integration for Django models.
  • Signals.
  • Configurable actions – show a thank you screen, send an email, etc.
  • Built-in statistics in the dashboard
  • Basic field types answers can be filtered in the dashboard

Since it was made to be flexible from the beginning, this can be extended to add new fields, validations and so on.

We hope you enjoy it, and of coursed we are open to comments, questions and pull requests!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/cf0e43ee-3484-41e4-8f32-35112eed7ca2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Introduction to Pulpo-Forms

Tiago,

how are you?

It is really nice to hear that you like our new tool.

We have recently made public a demo project that is also available on GitHub - https://github.com/octobot-dev/pulpo-forms-examples .

In order to access the live demo you can go to:


User: pulpo
Password: pulpo123

Soon we will publish a new post with more details about the features.

Hope you like it and we are open to question or suggestions for improvements.

Luciano





Luciano Ferrari
Skype: octobot.io
UY Phone: (+598) 2716 71 86




2015-07-31 13:40 GMT-03:00 Tiago Almeida <tiago.b.almeida@gmail.com>:
Hi,

Sounds cool! Do you have screenshots / demos to see before installing?
Thanks,
Kind regards,

quinta-feira, 30 de Julho de 2015 às 22:46:12 UTC+1, Luciano Ferrari escreveu:

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 important features of this new open source tool:

  • Enable users to create forms with an easy drag&drop UI
  • Angular directives to render the form and the dashboard
  • Multi pages forms.
  • RESTful API
  • Customizable fields validations such as required, length,etc.
  • Conditional enable for fields based on other field values (e.g. in a food preferences survey, hide the 'How do you like your steak?' question to someone that previously answered that's a vegetarian).
  • Conditional enable for form pages based on other field values.
  • Versions and drafts.
  • Integration for Django models.
  • Signals.
  • Configurable actions – show a thank you screen, send an email, etc.
  • Built-in statistics in the dashboard
  • Basic field types answers can be filtered in the dashboard

Since it was made to be flexible from the beginning, this can be extended to add new fields, validations and so on.

We hope you enjoy it, and of coursed we are open to comments, questions and pull requests!


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFJtJhHvrHu7yV599VRHc75Y0Y8ri29TcWVWF21Nmb2YEQ-9Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Introduction to Pulpo-Forms

Hi,

Sounds cool! Do you have screenshots / demos to see before installing?
Thanks,
Kind regards,

quinta-feira, 30 de Julho de 2015 às 22:46:12 UTC+1, Luciano Ferrari escreveu:

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 important features of this new open source tool:

  • Enable users to create forms with an easy drag&drop UI
  • Angular directives to render the form and the dashboard
  • Multi pages forms.
  • RESTful API
  • Customizable fields validations such as required, length,etc.
  • Conditional enable for fields based on other field values (e.g. in a food preferences survey, hide the 'How do you like your steak?' question to someone that previously answered that's a vegetarian).
  • Conditional enable for form pages based on other field values.
  • Versions and drafts.
  • Integration for Django models.
  • Signals.
  • Configurable actions – show a thank you screen, send an email, etc.
  • Built-in statistics in the dashboard
  • Basic field types answers can be filtered in the dashboard

Since it was made to be flexible from the beginning, this can be extended to add new fields, validations and so on.

We hope you enjoy it, and of coursed we are open to comments, questions and pull requests!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e0bf7763-f5ea-404f-9636-d1b82ecc071b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Re. My Django Book.

I am also looking for books which provide more of examples. The two scoops of Django is more of doing things right than tutoring as MOnobot said. This are the following things I want to learn in Django

I want to learn how to manually create form rather than creating modelform. 
Combing forms from multiple models and show them under one view. 

Rgards,
Sarfaraz Ahmed

On Fri, Jul 31, 2015 at 9:01 PM, monoBOT <monobot.soft@gmail.com> wrote:
two scoops is more like ways of doing things right than really explaining or tutoring.

2015-07-31 15:33 GMT+01:00 Mark Phillips <mark@phillipsmarketing.biz>:
The django docs are excellent. However, if you are more of a book person, then try Try Two Scoops of Django (http://twoscoopspress.org/) - well written and updated.

Mark

On Fri, Jul 31, 2015 at 6:33 AM, rmschne <rmschne@gmail.com> wrote:
I'm no way an advanced user, but I found the book simplistic and not worth it.  Django's own documentation is much better https://docs.djangoproject.com

On Thursday, 30 July 2015 21:35:16 UTC+1, Steve Burrus wrote:
 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?


   

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/272afb4b-6e50-45be-92a8-4580049c3a3f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2PGuSBiLChgYu9jk%3DS_5otDK1WMeZsfJqYYjKTMXh0TSQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BxOsGAO8imS8%3D0OaDZiCGXFsWoyDs%3DCMtrAknd-gEqT8k0vqg%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
Thanks with regards,
Sarfaraz Ahmed


--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEPJdiyQ9kFw%2BxUNVYFyUqU%2BDBJ1UsyakdeP7fVvJHMevPSwCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Re. My Django Book.

two scoops is more like ways of doing things right than really explaining or tutoring.

2015-07-31 15:33 GMT+01:00 Mark Phillips <mark@phillipsmarketing.biz>:
The django docs are excellent. However, if you are more of a book person, then try Try Two Scoops of Django (http://twoscoopspress.org/) - well written and updated.

Mark

On Fri, Jul 31, 2015 at 6:33 AM, rmschne <rmschne@gmail.com> wrote:
I'm no way an advanced user, but I found the book simplistic and not worth it.  Django's own documentation is much better https://docs.djangoproject.com

On Thursday, 30 July 2015 21:35:16 UTC+1, Steve Burrus wrote:
 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?


   

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/272afb4b-6e50-45be-92a8-4580049c3a3f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2PGuSBiLChgYu9jk%3DS_5otDK1WMeZsfJqYYjKTMXh0TSQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.



--
monoBOT
Visite mi sitio(Visit my site): monobotsoft.es/blog/

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BxOsGAO8imS8%3D0OaDZiCGXFsWoyDs%3DCMtrAknd-gEqT8k0vqg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re: Re. My Django Book.

The django docs are excellent. However, if you are more of a book person, then try Try Two Scoops of Django (http://twoscoopspress.org/) - well written and updated.

Mark

On Fri, Jul 31, 2015 at 6:33 AM, rmschne <rmschne@gmail.com> wrote:
I'm no way an advanced user, but I found the book simplistic and not worth it.  Django's own documentation is much better https://docs.djangoproject.com

On Thursday, 30 July 2015 21:35:16 UTC+1, Steve Burrus wrote:
 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?


   

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/272afb4b-6e50-45be-92a8-4580049c3a3f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2PGuSBiLChgYu9jk%3DS_5otDK1WMeZsfJqYYjKTMXh0TSQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

mezzanine uploadify HTTP Error

Hi!
I'm using Mezzanine for developing a web application but I got some pain with upload media library... Upload files works just fine with other table fields in my model but when I try to upload in media library the flash widget just say HTTP Error and no log can be found anywhere.
Did somebody have the same experience? Any idea how to debug this problem?

Thank you very much in advance for any replay and suggest.

Cheers

    Manuele

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/608d82b2-c2af-40dd-8764-44e570a3f9b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Re. My Django Book.

I'm no way an advanced user, but I found the book simplistic and not worth it.  Django's own documentation is much better https://docs.djangoproject.com

On Thursday, 30 July 2015 21:35:16 UTC+1, Steve Burrus wrote:
 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?


   

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/272afb4b-6e50-45be-92a8-4580049c3a3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Restricting CreateView

Hi James 

Many thanks for your reply.

David 

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6454acd7-4d5a-448b-9c49-ee52526b5aa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

you can use a technique from the zope world known as Annotations:
http://davidemoro.blogspot.co.uk/2015/02/kotti-cms-annotations-store-arbitrary-data.html
which basically means that you store additional data in a json field

have a look at:
https://github.com/octobot-dev/pulpo-forms-django
https://github.com/MarkusH/django-dynamic-forms
or https://wagtail.io/


On 31 July 2015 at 04:28, SriPrad <brs.pradeep@gmail.com> wrote:
> 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 and later versions. It seems that the functionality is merged in Django 1.7.
>
> Please advise.
>
> Regards,
> Srinivasa Pradeep
>
>
>
> On Thursday, July 30, 2015 at 5:08:07 PM UTC+5:30, vicherot wrote:
>> 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)
>>
>>
>> Now, for your exclusive problem, maybe using south (just like the project you say) you can do the changes to your database dinamically.
>>
>> Regards!
>>
>>
>>
>>
>>
>> --
>> Rafael E. Ferrero
>>
>>
>>
>> 2015-07-30 5:01 GMT-03:00 SriPrad <brs.p...@gmail.com>:
>>
>> 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 dynamically (reference: https://github.com/willhardy/dynamic-models)
>> The admin guys can modify the fields of this medical form from the admin site. At this time, I would like to modify the model to match the schema modifications done by admin guys.
>> I understand prior to Django 1.7, there was django.db.models.loading module that helped in this.
>>
>> With the current version of Django, how can I add/modify/delete the fields of the dynamic model dynamically?
>>
>> Your help and suggestions are most welcome.
>>
>> Regards,
>> Srinivasa Pradeep
>>
>>
>>
>>
>>
>> --
>>
>> 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...@googlegroups.com.
>>
>> To post to this group, send email to django...@googlegroups.com.
>>
>> Visit this group at http://groups.google.com/group/django-users.
>>
>> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6a62db2f-5dd7-417c-9d6b-fbbed6b5a149%40googlegroups.com.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> 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+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4d02e9dc-98dc-4120-ad19-caac524bc57c%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Best Regards,

Christian Ledermann

Newark-on-Trent - UK
Mobile : +44 7474997517

https://uk.linkedin.com/in/christianledermann
https://github.com/cleder/


<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don't drive species to extinction

2) Don't destroy a habitat that species rely on.

3) Don't change the climate in ways that will result in the above.

}<(((*>

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CABCjzWp-ayiRpB%2B3Ab332wKzj4%3DDfQS9k4dArs6Wc1YtaMaXNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Thursday, July 30, 2015

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

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 and later versions. It seems that the functionality is merged in Django 1.7.

Please advise.

Regards,
Srinivasa Pradeep



On Thursday, July 30, 2015 at 5:08:07 PM UTC+5:30, vicherot wrote:
> 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)
>
>
> Now, for your exclusive problem, maybe using south (just like the project you say) you can do the changes to your database dinamically.
>
> Regards!
>
>
>
>
>
> --
> Rafael E. Ferrero
>
>
>
> 2015-07-30 5:01 GMT-03:00 SriPrad <brs.p...@gmail.com>:
>
> 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 dynamically (reference: https://github.com/willhardy/dynamic-models)
> The admin guys can modify the fields of this medical form from the admin site. At this time, I would like to modify the model to match the schema modifications done by admin guys.
> I understand prior  to Django 1.7, there was django.db.models.loading module that helped in this.
>
> With the current version of Django, how can I add/modify/delete the fields of the dynamic model dynamically?
>
> Your help and suggestions are most welcome.
>
> Regards,
> Srinivasa Pradeep
>
>
>
>
>
> --
>
> 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...@googlegroups.com.
>
> To post to this group, send email to django...@googlegroups.com.
>
> Visit this group at http://groups.google.com/group/django-users.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/6a62db2f-5dd7-417c-9d6b-fbbed6b5a149%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4d02e9dc-98dc-4120-ad19-caac524bc57c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: how to deploy django 1.8 on openshift

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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/8b9fd708-21d0-4272-8bef-ee0c05170ab1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Restricting CreateView

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 queried).

You shouldn't use get_queryset() to control access to the view itself, only use it to filter down the available objects already within the database. Those two ideas sound similar, but are handled differently.

What you are likely looking for is a row level (per object) permission system (the built-in permission system is table level). There are several packages available to assist:


Many of the authentication packages also have authorization (permission checking) built in. 


django-guardian is probably the most popular of all of these. I haven't used any of them personally. 

The authorization package you choose should work in tandem with the get_queryset() methods you've probably already defined.

-James


On Thu, Jul 30, 2015 at 3:20 AM, David <davidwills@adviserbreakthrough.co.uk> wrote:
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 member of Y to view at all
CreateView need to be a member of Y to view/submit

Thank you

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/49fb6fc3-7b86-424c-af97-d50824762dd2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciVVh5tPmPxcWUEJay82%3DBxPQvLtv1DbiHEKUdLw6bjHGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Introduction to Pulpo-Forms

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 important features of this new open source tool:

  • Enable users to create forms with an easy drag&drop UI
  • Angular directives to render the form and the dashboard
  • Multi pages forms.
  • RESTful API
  • Customizable fields validations such as required, length,etc.
  • Conditional enable for fields based on other field values (e.g. in a food preferences survey, hide the 'How do you like your steak?' question to someone that previously answered that's a vegetarian).
  • Conditional enable for form pages based on other field values.
  • Versions and drafts.
  • Integration for Django models.
  • Signals.
  • Configurable actions – show a thank you screen, send an email, etc.
  • Built-in statistics in the dashboard
  • Basic field types answers can be filtered in the dashboard

Since it was made to be flexible from the beginning, this can be extended to add new fields, validations and so on.

We hope you enjoy it, and of coursed we are open to comments, questions and pull requests!

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/55f128d8-8aa2-4a79-9adc-37e2463e3cab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Does imports of related models affect cascade deletion?

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 <glicerinu@gmail.com> wrote:
On Thu, Jul 30, 2015 at 3:38 PM, Markus Amalthea Magnuson
<markus.magnuson@gmail.com> 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.
>
> Is this true? I have not found it in the documentation and would like to add
> a reference to the code comment so others won't be as confused as I am.

Is this models module called models.py and does it live inside a
Django application listed in INSTALLED_APPS?


--
Marc

--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/wLiEuzqUVeQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BDCN_tKE56qJPJ339uL0Zo%2BvEDSsPdTnLMODHC_3H4hd856dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAOXH8SXRVShSrLuPjZuPDPhbEEdc-Bi9v5JQm-xHf181iCzMKA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Re. My Django Book.

 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?


   

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/de78f7fa-cb87-4d88-a9c6-886f43841bb2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Custom Field

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.

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/10405523-935b-447d-9dea-70e4c6d68de4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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 wrote:
On Thu, Jul 30, 2015 at 4:08 PM, Rich Lewis <rich....@gmx.co.uk> 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 A instance.  Each A
> instance can have many B instances.  The order of Bs are important for As.
>
> I want to do something like this:
>
> class A(models.Model):
>   b_1 = models.ForeignKey(B)
>   b_2 = models.ForeignKey(B)

This would fail here, when you have more than one foreign key to the
same model, you must supply a related_name argument on one of them,
which is used for the inverse relation on the related object. Which
leads us in to...

>
> class B(models.Model):
>   pass
>
> Such that i can do:
>
>>>> b1, b2, b3 = B(), B(), B()
>>>> a1, a2 = A(b_1=b1, b_2=b2), A(b_1=b2, b_2=b3)
>>>> b2.as
> [<A ... >, <A ... >] #(order doesn't matter)

Typically, B instances would have an attribute named 'a_set' (the
lower case model name of the model it is related to, with "_set"
appended). When you have multiple relationships with the same model,
as I mentioned you must supply your own related_name arguments. In
which case, with the models you mentioned, you could then do something
like this:

>>> b2.a1_set.all() | b2.a2_set.all()
> [<A ..>, <A ..>]

>
> I expect I could eventually do something a bit hacky that would work, but
> what would be the best way to handle this?

I would say the above is the hacky way. You could have the same B
assigned to b_1 and b_2 and would have duplicates in the set, and no
way to specify DB constraints to limit it.

Given that you anticipate being able to retrieve all the A's for a
particular B, regardless of how they are related, I would model it as
a M2M with a through table holding any additional information about
the relationship, using the through table to add DB level constraints.

Cheers

Tom

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/daa601f5-12d5-44fe-8c58-f2f052629261%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

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 <rich....@gmx.co.uk>:
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 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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/40eadb77-0205-403d-92a8-52859645c4fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Re: Does imports of related models affect cascade deletion?

On Thu, Jul 30, 2015 at 3:38 PM, Markus Amalthea Magnuson
<markus.magnuson@gmail.com> 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.
>
> Is this true? I have not found it in the documentation and would like to add
> a reference to the code comment so others won't be as confused as I am.

Is this models module called models.py and does it live inside a
Django application listed in INSTALLED_APPS?


--
Marc

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BDCN_tKE56qJPJ339uL0Zo%2BvEDSsPdTnLMODHC_3H4hd856dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

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

On Thu, Jul 30, 2015 at 4:08 PM, Rich Lewis <rich.lewis@gmx.co.uk> 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 A instance. Each A
> instance can have many B instances. The order of Bs are important for As.
>
> I want to do something like this:
>
> class A(models.Model):
> b_1 = models.ForeignKey(B)
> b_2 = models.ForeignKey(B)

This would fail here, when you have more than one foreign key to the
same model, you must supply a related_name argument on one of them,
which is used for the inverse relation on the related object. Which
leads us in to...

>
> class B(models.Model):
> pass
>
> Such that i can do:
>
>>>> b1, b2, b3 = B(), B(), B()
>>>> a1, a2 = A(b_1=b1, b_2=b2), A(b_1=b2, b_2=b3)
>>>> b2.as
> [<A ... >, <A ... >] #(order doesn't matter)

Typically, B instances would have an attribute named 'a_set' (the
lower case model name of the model it is related to, with "_set"
appended). When you have multiple relationships with the same model,
as I mentioned you must supply your own related_name arguments. In
which case, with the models you mentioned, you could then do something
like this:

>>> b2.a1_set.all() | b2.a2_set.all()
> [<A ..>, <A ..>]

>
> I expect I could eventually do something a bit hacky that would work, but
> what would be the best way to handle this?

I would say the above is the hacky way. You could have the same B
assigned to b_1 and b_2 and would have duplicates in the set, and no
way to specify DB constraints to limit it.

Given that you anticipate being able to retrieve all the A's for a
particular B, regardless of how they are related, I would model it as
a M2M with a through table holding any additional information about
the relationship, using the through table to add DB level constraints.

Cheers

Tom

--
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+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFHbX1%2B7-KieRLGT_hG-UDC6zeyg%2Bb8d%3D7XtEK4EEM8nFvzFng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.