Generic way to create forms (not admin forms)

2014-09-15 Thread Subodh Nijsure
Hi, In my application I have situation where I would like users to define elements in a form -- things like buttons, text input fields, radio buttons etc. And save those forms as templates, and then at later time instantiate that user-defined form and save data associated with that form. ( Basi

Re: Right way to create proxy to User model in Django 1.7

2014-09-15 Thread izabella.gal
Hi Andrew, My custom model looks like this: from django.contrib.auth.models import User class MyUser(User): class Meta: proxy = True def my_custom_method(self): return "Something" This is a proxy class and it's only scope is to extend the User model with a method. And h

Re: User Created Objects (models)

2014-09-15 Thread Pitchblack
Is there a way to add the user to the data model, so it knows who created the record and who updated it last? On Sunday, October 20, 2013 5:24:22 PM UTC-7, Ideo Rex wrote: > > Hello, > I'm relatively new to Django. So I have a working (local) web application. > I can create new model objects fro

What's the best way to track created by and modified by in Django 1.7?

2014-09-15 Thread Pitchblack
Hello, I am sure that I am not the first person to ask this question, but I want to know the best way to track who created or modified a record in my settings defined within models.py. Is there something new and great added to 1.7 or something that already exists in older versions? Thank you

What't the best way to track created by and modified by in Django 1.7?

2014-09-15 Thread Michael Martin
Hello, I am sure that I am not the first person to ask this question, but I want to know the best way to track who created or modified a record in my settings defined within models.py. Is there something new and great added to 1.7 or something that already exists in older versions? Thank you in

Re: Django Modeling setting an integer value to a negative value

2014-09-15 Thread Michael Martin
Sorry, I am just blind as a bat. I didn't realize that there were two settings with very similar names. On Mon, Sep 15, 2014 at 6:09 PM, Michael Martin wrote: > Is it possible to default a integer to a negative number with Django > Modeling? > > I did the following, but the value in the display

Re: Django Modeling setting an integer value to a negative value

2014-09-15 Thread Michael Martin
Dam, on top of that I marked the fields as editable=False and it wasn't working as expected. I was able to change the value from 1 to 2 using the Admin. Why isn't this working? I read here that it should work, https://docs.djangoproject.com/en/1.7/ref/models/fields/#editable editableIf False,

Django Modeling setting an integer value to a negative value

2014-09-15 Thread Michael Martin
Is it possible to default a integer to a negative number with Django Modeling? I did the following, but the value in the display shows 1 not -1 ces_out_servicegrid_polling_interval=models.IntegerField(default=-1, editable=False) -- You received this message because you are subscribed to the Go

Re: Return to paginated ListView page after update

2014-09-15 Thread James Y
There's probably better solution, but this works: 1) added a page_number to the view 2) subclass dispatch and in get page from request: self.page_number = request.REQUEST['page'] 3) subclass get_context_data and put the page number in a hidden files on the form: context['hidden_f

Re: LIMIT 21 on primary key lookups

2014-09-15 Thread Arnold Krille
On Sun, 14 Sep 2014 17:48:18 +0100 Ben Collier wrote: > So why 21, precisely? Because its half the answer? signature.asc Description: PGP signature

Re: static files in Django 1.7 ; Anything was change?

2014-09-15 Thread Ricardo Daniel Quiroga
hi in you setings.py add in INSTALLED_APPS add 'django.contrib.staticfiles', STATIC_URL = '/media/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, "media"), #you template path ) 2014-09-15 14:27 GMT-03:00 Fellipe Henrique : > I in development mode, DEBUG = True. using the django serv

Re: static files in Django 1.7 ; Anything was change?

2014-09-15 Thread Fellipe Henrique
I in development mode, DEBUG = True. using the django server. I already run './manage.py collectstatic' they create all my static in my path.. but don't work... T.·.F.·.A.·. S+F *Fellipe Henrique P. Soares* e-mail: > echo "lkrrovknFmsgor4ius" | perl -pe \ 's/(.)/chr(ord($1)-2*3)/ge' *Blog:

Re: django 1.7 Groups

2014-09-15 Thread John Rodkey
I just thought of this this morning too. Thanks for the recommendation -- 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.co

Re: Right way to create proxy to User model in Django 1.7

2014-09-15 Thread Andrew Pinkham
Hi Izabella, Could you provide your custom user model declaration? According the the documentation, you should be inheriting from `AbstractBaseUser`. https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#substituting-a-custom-user-model https://docs.djangoproject.com/en/1.7/topics/auth

Re: django 1.7 Groups

2014-09-15 Thread marc
Hi, changing the base Group model is not very easy. My suggestion is to create a ManyToMany relation on your Company model. class Company(models.Model): groups = models.ManyToManyField("auth.Group") The design allows in theory many companies to have the same group, but this you c

Re: static files in Django 1.7 ; Anything was change?

2014-09-15 Thread Vladimir Chukharev
Yes, there are some changes, see release notes. In particular, you probably need to run 'django-admin collectstatic'. -- 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 ema

Re: Right way to create proxy to User model in Django 1.7

2014-09-15 Thread izabella.gal
Thank you for your answer. I corrected my code how you said: MyUser class inherits now directly from auth.models.User and in settings I set AUTH_USER_MODEL = 'myapp.MyUser' and I got another error: TypeError: MyUser cannot proxy the swapped model 'myapp.MyUser'. I found this problem on stackov

Re: Preventing illegal method calls

2014-09-15 Thread Jagger
Thank you, Ben! 2014. szeptember 15., hétfő 6:45:42 UTC+2 időpontban Ben Scherrey a következőt írta: > > This is the nature of the HTTP protocol and RESTful architectural style. > Understand that a URI is just an address for a resource - it is not an > action or command. The HTTP verbs are the