Re: pyjs - a compiler from Python to JavaScript

2015-08-08 Thread Russell Keith-Magee
On Sat, Aug 8, 2015 at 4:27 PM, Uri Even-Chen wrote: > Hi Russ, > > I checked the projects you mentioned, but is it possible to communicate > with other JavaScript scripts such as jQuery, jQuery UI and plugins for > jQuery? I would like to have a way to communicate from Python to JavaScript > in

Re: Foreign key in a ModelForm

2015-08-08 Thread James Schneider
Try removing the .values_list() portion of the query set in your ModelForm. You should be passing a query set, not a list of values. The form knows how to iterate through the query set. -James On Aug 8, 2015 4:59 AM, wrote: > I searched in the web for some example of setting a FK in a ModelForm

Re: Django Logical Deletes on Models

2015-08-08 Thread Peter of the Norse
Steal code from the current Model.delete method. It uses django.db.models.deletion.Collector to find the associated objects. I would extend that to do what you want. > On Aug 4, 2015, at 7:38 AM, psychok7 wrote: > > So i decided to fork pinax-models because i need the capability of soft > d

Re: problem with using generic views

2015-08-08 Thread James Schneider
Did you complete the following section after changing the urls.conf? The URL changes won't work until you modify the views.py file in the next section. https://docs.djangoproject.com/en/1.8/intro/tutorial04/#amend-views -James On Aug 8, 2015 6:31 AM, "Doaa Hassan" wrote: > Hi all, > > I am tryi

Re: pyjs - a compiler from Python to JavaScript

2015-08-08 Thread Robert
On 8/7/2015 7:00 AM, Uri Even-Chen wrote: To Django users, Are you familiar with pyjs ? I saw the website and I see that the latest stable release is from May 2012. Is it possible to use pyjs to compile Python to JavaScript? Which versions of Python are supported? Are vers

problem with using generic views

2015-08-08 Thread Doaa Hassan
Hi all, I am trying to convert poll app introduced on: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ to use the generic views system as described on: https://docs.djangoproject.com/en/1.8/intro/tutorial04/ However, when I convert the URLconf by opening the polls/urls.py and ch

Re: Upload new file to the uploaded file path

2015-08-08 Thread Robin Lery
It works perfectly! I am using it to upload in s3, and even for s3 it works as it is supposed to. I am really grateful to you. Thank you. On Wed, Aug 5, 2015 at 4:37 PM, 'Tom Evans' via Django users < django-users@googlegroups.com> wrote: > On Tue, Aug 4, 2015 at 9:45 PM, Robin Lery wrote: > >

Foreign key in a ModelForm

2015-08-08 Thread durirompepc
I searched in the web for some example of setting a FK in a ModelForm (bound and unbound), but the examples I founded didn't worked for me. The best thing I think I've is this: *forms.py* *class RegistroComentarioForm(ModelForm):def __init__(self, *args, **kwargs):super(Regi

Re: About the auto-increase PK

2015-08-08 Thread ADEWALE ADISA
Am not 100% sure about this, but what about creating a normal Integer field, then override the save method of the model to auto-increment the value starting from 1000 ? So that any new record added, its value will be 1000+ total record +1 On Aug 8, 2015 11:11 AM, "Holland_zwz" wrote: > Hi all, >

Re: About the auto-increase PK

2015-08-08 Thread Markus Holtermann
Hi Hollandz, You can't do that from within Django automatically. You'd need to write your own database migration to update the database as the assignment of the primary key value is part of the database and not Django. Have a look at https://docs.djangoproject.com/en/1.8/ref/migration-operatio

About the auto-increase PK

2015-08-08 Thread Holland_zwz
Hi all, I want to add one auto-increase PK which start from one given value(such as start from 1000). I try to write the model as following: class MyModel(models.Model): mid = models.AutoField(verbose_name='My ID',primary_key=True,default='1000') But only one record can be add when i add

Re: pyjs - a compiler from Python to JavaScript

2015-08-08 Thread Uri Even-Chen
Hi Russ, I checked the projects you mentioned, but is it possible to communicate with other JavaScript scripts such as jQuery, jQuery UI and plugins for jQuery? I would like to have a way to communicate from Python to JavaScript in the client side, otherwise I really think we will not be able to u

Re: pyjs - a compiler from Python to JavaScript

2015-08-08 Thread Uri Even-Chen
Hi Russ, Thanks for the information. Yes, I'm looking for software that is ready for production, or at least works well in most platforms. I also know JavaScript, but I was thinking about programming in Python for the client side too. I will check the projects you mentioned, thank you! Uri. *Ur