Problems with authenticate in Django 1.10

2019-08-23 Thread Marcos Fraga
HI, I'm trying to migrate an application from *Django1.8.5/Python2.7* to *Django 1.10/Python3.6* and having problems with code below: def clean_password(self): username = self.cleaned_data.get('username') password = self.cleaned_data.get('password') user =

Gravar um valor num atributo novo da models User

2019-07-05 Thread Marcos - GMail
de olho na views.py vocês vão poder me ajudar *Marcos Alves* -- 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.com. To

Persistir campo novo na models User - Não consigo

2019-07-02 Thread Marcos G.A
Preciso gravar na models User do django um campo denominado "Role" do tipo boolean. Este campo vai ser True quando for um cliente se cadastrando e False para quando for um Fornecedor. A principio, no que tange visualmente, o campo aparece na tela e eu consigo marcar ele, mas seu valor não

Re: Translate permissions Django

2016-02-29 Thread Marcos Serrano
<https://lh3.googleusercontent.com/-gF112g_arto/VtRdzT-zGbI/Ajo/Fk9BqLlpj6A/s1600/Captura%2Bde%2Bpantalla%2Bde%2B2016-02-29%2B16%253A02%253A47.png> El lunes, 29 de febrero de 2016, 14:14:42 (UTC+1), Marcos Serrano escribió: > > Hello, > > How yo translate the default

Translate permissions Django

2016-02-29 Thread Marcos Serrano
Hello, How yo translate the default permissions django. Keywords (Add, Delete ... ) http://stackoverflow.com/questions/29398900/django-permissions-and-contenttypes-translations I tried to do something like this but it has not worked for me. Thx. -- You received this message because you are

Re: Turn off migrations completely in Django 1.7

2015-08-25 Thread Marcos Eliziario
Changing the database accidentally can be avoided simply by adjusting the privileges of the database user django uses. Flexibility in a software project always come out at the expense of simplicity. So, generally, django developers are right to avoid rarely need features in exchange for a

Re: What are some 3rd party good django applications which handle user registration,login and authentication?

2015-06-08 Thread Marcos Lewis
For registration I like to use django-registration-redux. https://django-registration-redux.readthedocs.org/en/latest/ El lunes, 8 de junio de 2015, 15:55:36 (UTC-3), akshat escribió: > > I know some applications and have also used them but I want to know what > other django users use and love?

Re: [View Django] Problem with view that makes add and update

2013-08-30 Thread Marcos Luiz Wilhelm
if it is the best practice, but I think a simple solution. Thanks C. Kirby. Hug! Em segunda-feira, 26 de agosto de 2013 12h40min52s UTC-3, Marcos Luiz Wilhelm escreveu: > > Hello! > I'm having problems with a view that makes add and update > The view generates a new record rather

[View Django] Problem with view that makes add and update

2013-08-26 Thread Marcos Luiz Wilhelm
Hello! I'm having problems with a view that makes add and update The view generates a new record rather than change a instance. My code is this: http://pastebin.com/rZNAeN0p Someone can help me please? -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Any Tutorials on Django similar to Web2py ????????????????

2013-08-20 Thread Marcos Moyano
There are several ways to manage sessions, or cache. That's up to you according to your needs. You can find documentation about sessions, caching and much more here: https://docs.djangoproject.com/en/1.5/ Rgds On Tue, Aug 20, 2013 at 1:12 PM, JAI PRAKASH SINGH < jaiprakashsingh...@gmail.com>

Re: Republish Static Files

2013-05-07 Thread Marcos Moyano
Did you run collectstatic ? https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#collectstatic On Tue, May 7, 2013 at 9:41 PM, wrote: > Hello, > > I have site that renders a chart using HighCharts with data from static > csv files, as well as a link to download

Re: x|add:-1 in templates doesn't work as I expect.

2013-04-23 Thread Marcos Borunda
for others looking for an answer, put your value between double quotes: Previous | Next El jueves, 6 de diciembre de 2007 15:44:32 UTC-6, J. Clifford Dyer escribió: > > Hello. > > I'm trying to get a template to render previous and next links on a series > of pages, as follows. > > Previous |

Re: Good tutorials on celeryd as a daemon needed?

2013-04-08 Thread Marcos Moyano
http://ask.github.io/celery/cookbook/daemonizing.html On Mon, Apr 8, 2013 at 6:01 AM, sparky wrote: > Hi Django people, > > I'm finding it difficult to get my head around running celeryd as a daemon > from the docs on Ubuntu. Does anyone know of any good tutorials or

Re: Markers on geodjango

2012-09-14 Thread Marcos Moyano
http://invisibleroads.com/tutorials/geodjango-googlemaps-build.html Like that? Marcos On Fri, Sep 14, 2012 at 6:30 AM, Coulson Thabo Kgathi <zeeco...@gmail.com>wrote: > can i place markers on geodjango maps, cant figure out how to do that > > -- > You received this m

Re: Is there such a open source django project?

2012-04-17 Thread Marcos Moyano
If there is, this is a good place to look for it: http://djangopackages.com/ Marcos On Tue, Apr 17, 2012 at 7:12 AM, James Deng <jtd...@gmail.com> wrote: > Hi all, > > I have a case to manage my staff for customer support, basically I need a > time based schedule table. th

Re: Django ExtraField

2012-02-24 Thread Marcos Moyano
You can set a hidden input widget to the form field. Rgds, Marcos On Fri, Feb 24, 2012 at 11:26 AM, coded kid <duffleboi...@gmail.com> wrote: > Hi guys, How can I get rid of the field that's beside django comment > textarea? (the field, if users fill the field[honeypot] the use

Re: Which IDE should I use for Django?

2011-12-19 Thread Marcos Moyano
emacs +1 On Mon, Dec 19, 2011 at 1:46 PM, george wrote: > emacs +1 > > On Dec 19, 3:42 pm, Masklinn wrote: > > On 2011-12-19, at 16:30 , Andre Terra wrote: > > > > > > > > > What do you mean by embedded Django interpreter? An instance of python > >

Form for inline formset

2011-08-27 Thread Marcos Moyano
Can someone please tell me how can I specify a form to be used by every form inside an inline formset (if possible)? Thanks in advance! Marcos -- Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems. Jamie Zawinski

Re: Django Development environment

2011-08-25 Thread Marcos Moyano
Dev. Arch Linux, python2.7, django-1.3, virtualenv, postgresql (if possible), south, django-extensions, Emacs Dep. Ubuntu Server, fabric, Nginx, supervisord, uwsgi Rgds, Marcos On Mon, Aug 22, 2011 at 7:07 PM, Stephen Jackson < jackson.stephe...@gmail.com> wrote: > I am new to

Re: signals pre_save vs model's save()

2011-05-28 Thread Marcos Moyano
__init__.py I just do: import app_name.signals Rgds, Marcos On Sat, May 28, 2011 at 7:05 AM, Mateusz Harasymczuk <mate...@harasymczuk.pl > wrote: > I am thinking about splitting my model's save() method over few signals. > > For example, stripping spaces and making string cap

Re: django help

2011-04-30 Thread Marcos Moyano
Read the static-files docs On Sat, Apr 30, 2011 at 4:14 AM, Sunil Chugh wrote: > how can i used static_root > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to

Re: how to setup apache server for django?

2011-04-06 Thread Marcos Moyano
You need to create a VirtualHost for each one of your projects. http://httpd.apache.org/docs/2.0/vhosts/ Marcos On Wed, Apr 6, 2011 at 5:24 AM, ug Charlie <ug.char...@gmail.com> wrote: > I have tried whole day. And I just got a new django project works. > > But I want my old pr

Re: fixtures with updated timestamps

2011-03-30 Thread Marcos Moyano
You can write a pre_save signal http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save Hope it helps, Marcos On Wed, Mar 30, 2011 at 8:09 AM, Robert Šmol <smol.rob...@gmail.com> wrote: > Hi, > > is it possible to load fixtures of models that have a

Re: values_list of ordered annotated QuerySet

2011-03-22 Thread Marcos Moyano
This should work without grabbing the entire table: [x[0] for x in Wizard.objects.filter(**filterargs).annotate(wpower=Sum('creatures__power')).order_by('- wpower').values_list('id', 'wpower')] Rgds, Marcos On Tue, Mar 22, 2011 at 5:25 PM, Andreas Pfrengle <a.pfren...@gmail.com>wrote:

Re: Where can I find the admin/base_site.html

2011-02-23 Thread Marcos Moyano
It depends on what you are using. For me is /usr/lib/python2.7/site-packages/django/contrib/admin/templates/admin/ Hope it helps. On Wed, Feb 23, 2011 at 6:06 AM, DJ Chung wrote: > I am going through the tutorial on Djangoproject.com. I'm trying to > work on templates and

Re: External Javascript Files

2011-02-17 Thread Marcos Moyano
you need to put it in your media folder. http://docs.djangoproject.com/en/1.2/howto/static-files/ Rgds, Marcos On Thu, Feb 17, 2011 at 2:44 PM, hank23 <hversem...@stchas.edu> wrote: > Is it possible to use external javascript files with a django app? If > so what folder does the jav

Re: site styling works with development server but not apache

2011-02-17 Thread Marcos Moyano
irtualHost configuration. Rgds, Marcos On Thu, Feb 17, 2011 at 2:23 PM, Ashish Agarwal <agarwal1...@gmail.com>wrote: > I'm still having trouble. My directory structure is: > > /usr/local/www/static > | > +- contrib/admin/media -- symlink to django/contrib/admin/media > | > +- m

Re: imported tuples/variables don't get translated

2011-02-08 Thread Marcos Moyano
Are you doing: from django.utils.translation import ugettext_lazy as _ ? or: from django.utils.translation import ugettext as _ ? The first one shoud work. Rgds, Marcos On Tue, Feb 8, 2011 at 7:11 PM, Ivo Brodien <i...@brodien.de> wrote: > If I import some tuple which is used fo

Re: Looking for IDE + FTP

2011-02-08 Thread Marcos Moyano
On Tue, Feb 8, 2011 at 5:43 PM, Daniel Roseman wrote: > On Tuesday, February 8, 2011 8:30:54 PM UTC, Karen McNeil wrote: >> >> I have three Django sites that I've been working on recently and I've >> been doing most of the development work in Dreamweaver. I don't use >>

Re: Change null representation when you're using choices widget.

2011-02-04 Thread Marcos Moyano
s/left/leave/ sorry fot the double post. On Fri, Feb 4, 2011 at 11:37 AM, Marcos Moyano <marcosmoy...@gmail.com>wrote: > Remove (None, "No Period") from your choices and left the required=False on > your form field. That should work. > > Rgds, > Marcos > > &g

Re: Change null representation when you're using choices widget.

2011-02-04 Thread Marcos Moyano
Remove (None, "No Period") from your choices and left the required=False on your form field. That should work. Rgds, Marcos On Fri, Feb 4, 2011 at 11:31 AM, Marc Aymerich <glicer...@gmail.com> wrote: > On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans <tevans...@googlemail.co

Re: i18n django models

2011-01-07 Thread Marcos Moyano
I've worked on/with this app https://github.com/Anue/django-polyglot/ Hope it helps. Rgds, Marcos On Fri, Jan 7, 2011 at 12:20 PM, Mo Mughrabi <mo.mughr...@gmail.com> wrote: > Hello, > > in my design there are some models where I need to store certain fields in > diff

Re: models queryset and permissions

2011-01-05 Thread MarcoS
Hi Danfi, thanks for your reply. This help me! On 5 Gen, 10:06, Danfi <tda...@gmail.com> wrote: > Esame: > name = models.Foreignkey(User) > ... > > Then queryset=Esame.name.get_rows_with_permission(Ecg(),'add') > > On 1月4日, 下午8时02分, MarcoS <marc.se...@gmail.com>

Re: models queryset and permissions

2011-01-04 Thread MarcoS
The ModelMultipleChoicheField will return Esame objects -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

models queryset and permissions

2011-01-04 Thread MarcoS
Hi people, probably I'm making a mountain out of a molehill but I can't figure how to solve this problem; I've a form with a ModelMultipleChoiceField. The queryset will contains all models for which the user has a particular permission (django.contrib.auth.models.Permission) (can_add). This is

Re: Date Error in Admin Form

2010-12-29 Thread Marcos Moyano
Take a look at the docs on how to set up valid input formats http://docs.djangoproject.com/en/dev/ref/settings/?from=olddocs#date-format Rgds, Marcos On Wed, Dec 29, 2010 at 1:39 PM, ckar...@googlemail.com < ckar...@googlemail.com> wrote: > Hi everybody, > > I'm getting

Retrieve all referenced foreign key objects

2010-12-21 Thread MarcoS
Hi, I've some models with a ForeignKey like this class Object1 name = models.varchar(max_length=50) class Object2 name = models.varchart(max_length=50) referenced_field = models.ForeignKey(Object1) class Object3 name = models.varchart(max_length=50) referenced_field =

Re: simple.direct_to_template and query objects

2010-12-16 Thread MarcoS
Yes, you're correct. Thank you so much On 16 Dic, 13:40, Marcos Moyano <marcosmoy...@gmail.com> wrote: > I think you are looking for object_detail, not > direct_to_template.http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-... > > Rgds, > Marcos > &g

Re: simple.direct_to_template and query objects

2010-12-16 Thread Marcos Moyano
I think you are looking for object_detail, not direct_to_template. http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-list-detail-object-detail Rgds, Marcos On Thu, Dec 16, 2010 at 9:32 AM, MarcoS <marc.se...@gmail.com> wrote: > Hi people, I want to define

simple.direct_to_template and query objects

2010-12-16 Thread MarcoS
Hi people, I want to define a generic view using simple.direct_to_template, something like this: (r'^detail_event/(?P\d+)/$', simple.direct_to_template, { 'extra_context': {'event': Event.objects.get(id=object_id),} }), Of course this doesn't work, django tell me that 'object_id' is

Re: Display related field in queryset

2010-12-13 Thread Marcos Moyano
You can use field lookups: http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups-intro ie: Travels.objects.values('date', 'destination__name') Rgds, Marcos On Mon, Dec 13, 2010 at 6:51 AM, nsbk <pedro...@gmail.com> wrote: > Hello, > > I'm using http://code.goog

Re: Extending AdminSite for custom views

2010-12-12 Thread Marcos Moyano
before loading all the other admin urls. Rgds, Marcos On Sat, Dec 11, 2010 at 1:33 PM, William Grzybowski <willia...@gmail.com>wrote: > Hello, > > I am trying to extend AdminSite so I can provide custom views, so far > i have this: > > class MyAdminSite(AdminSite):

Re: Newbie question: many-to-many model creation

2010-12-10 Thread Marcos Moyano
http://www.djangoproject.com/documentation/models/many_to_many/ Rgds, Marcos On Fri, Dec 10, 2010 at 8:54 AM, girish shabadimath < girishmss.1...@gmail.com> wrote: > Thanks for the reply,, > Here are my models > > class Checkers(models.Model): >name = models.CharF

Re: Removing title from each admin page

2010-11-26 Thread Marcos Moyano
Sure there is. You have to override the template: django/contrib/admin/templates/admin/base.html Create an admin folder within your templates folder, copy that template over that admin folder and remove the "{{ title }}" statement. Hope it helps. Marcos On Fri, Nov 26, 2010 at 7:3

Re: Display ForeignKey label rather than ID in a CharField

2010-11-20 Thread Marcos Moyano
You need to specify the __unicode__ method of the model holding the Fish object. ie: class FishHolder(models.Model): name = models.CharField(...) . def __unicode__(self): return self.name That should display the names instead of the ids. Rgds, Marcos On Fri, Nov 19, 2010

Re: how to hide a field on

2010-11-18 Thread Marcos Moyano
class PostForm(forms.ModelForm): registered_date = forms.DateTimeField(widget=forms.HiddenInput) class Meta: model = Post class PostAdmin(admin.ModelAdmin): form = PostForm admin.register(Post, PostAdmin) Rgds, Marcos On Thu, Nov 18, 2010 at 5:11 PM, Anderson Goulart

Re: django models: two foreignky for "User"

2010-11-09 Thread Marcos Moyano
Use related_name (http://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.ForeignKey.related_name) Rgds, Marcos At Tue, 9 Nov 2010 07:20:45 -0800 (PST), luckrill wrote: > > I write following models: > > class article(models.Model): > created_by = models.F

CRUD with FormWizard

2010-09-17 Thread MarcoS
Hi! I've a Create-Read-Update-Delete application and some form with multiple pages created with FormWizard. How can i allow users to update data using a FormWizard? With singles forms I'm using generic_views, but I can't figure how to do this with FormWizards.. -- You received this message

retrieving record id after form save with generic views

2010-07-15 Thread MarcoS
Hi people, I use django.views.generic.create_update.create_object to save a record and I need to retrieve the id of the record from the just-saved form. It's possible to do this using generic views? -- You received this message because you are subscribed to the Google Groups "Django users"

Create Dynamic data with mongokit

2010-05-28 Thread Marcos Daniel Petry
[2] (ipython traceback): can anyone help me with this? [1]http://paste.pocoo.org/show/219363/ [2]http://paste.pocoo.org/show/219367/ -- Marcos Daniel Petry http://mdpetry.net -- You received this message because you are subscribed to the Google Groups "Django users" grou

Re: Best solution to this problem?

2010-04-07 Thread Marcos Marín
Personally I like 2 best, it seems more flexible in case you later decide to show different kinds of links or other information (like a note that says the profile is viewable only to friends, etc.) On Wed, Apr 7, 2010 at 14:02, mtnpaul wrote: > I have a logged in user.

Re: PK and FK questions

2010-04-07 Thread Marcos Marín
Hi, I'm not too experienced with django myself so I will let someone else answer the rest of your questions. But for 2, wouldn't it be fairly simple to create primary keys for these tables? worst case scenario you just add a column that is a auto_incremented int and run a script to set it for

Re: Problems with model with optional FileField in Admin

2010-04-06 Thread Marcos Marín
Yes, sorry for not mentioning it. On Tue, Apr 6, 2010 at 08:12, Walt wrote: > Did you also specify null=True? > > > Walt > > -~ > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email

Re: Error when doing the tutorial

2010-04-05 Thread Marcos Marín
Make sure you have installed MySQLdb http://sourceforge.net/projects/mysql-python/ On Mon, Apr 5, 2010 at 21:31, John wrote: > Hello all, > > I am new to django and am doing the tutorial and when I run the > command below I get the following error. > > Does anyone know how

Problems with model with optional FileField in Admin

2010-04-05 Thread Marcos Marín
Hi, So I have a site where I want the client to be able to add/remove links from a menu on the site through the admin site. Usually these links are to files on the server but not always. So I created a Link model which has a name, file and url field. The plan here is that if a file is given it's

Re: File in admin with TabularInline don't get uploaded

2009-12-02 Thread Marcos Marín
Please disregard this message. It was a dumb mistake on my part and I found it. On Wed, Dec 2, 2009 at 16:08, Marcos Marín <marcosma...@gmail.com> wrote: > Hi, > > I have a site where you can create news items that can have attached files. > I'm using TabularInline so the t

File in admin with TabularInline don't get uploaded

2009-12-02 Thread Marcos Marín
Hi, I have a site where you can create news items that can have attached files. I'm using TabularInline so the the admin interface shows attached files in the same view where you create the news items. When I create a new news item and attach files it gives no errors, but the file isn't actually

Re: Modulo not working in query using extra() to define specific where

2009-11-30 Thread Marcos Marín
aig > > On Mon, Nov 30, 2009 at 8:50 AM, Marcos Marín <marcosma...@gmail.com>wrote: > >> Hi, I'm trying to do a query where I select all rows where a field is >> divisible by 2. In pure SQL this is what I want: >> select * from contenido_semestre where

Modulo not working in query using extra() to define specific where

2009-11-30 Thread Marcos Marín
Hi, I'm trying to do a query where I select all rows where a field is divisible by 2. In pure SQL this is what I want: select * from contenido_semestre where num % 2 = 0; which works fine. When trying to do it with Django I do Semestre.objects.extra(where=['num % 2 = 0']) But this gets me an empty

showing templates error to user

2009-08-14 Thread Marcos Daniel Petry
is when the user misses one of these filters, I would like to implement a kind of validation, showing where the error is, something similar to the debug Django, showing where the line is, not an "Internal Server Error" -- Marcos Daniel Petry http://m

Dynamic form and template rendering

2009-04-29 Thread MarcoS
Hi all, I post a problem, hoping someone can help me: I want to render a dynamic form which many rows how the number of entries from a database table (something similar at the list in the "change_list.html" template in admin) This is the model: class Book(models.Model): title =

adding views to admin site

2009-04-01 Thread MarcoS
Hi, I've a problem adding views to my admin site using Django 1.1 beta. I've defined inside my admin.py: class SeasonAdmin(admin.ModelAdmin): def get_urls(self): urls = super(SeasonAdmin, self).get_urls() my_urls = patterns('', (r'check_calendar/$',

Re: mp3 converstion

2009-03-31 Thread Marcos Marín
I'm not sure I understand the problem but I doubt it is a format problem. I think maybe the server does not have permission to write in the folder you are trying to save files too. On Tue, Mar 31, 2009 at 18:44, oregon10 wrote: > > DISCLAMER: I'm not a program - only

Re: overriding the UserChangeForm

2009-03-31 Thread Marcos Marín
, 2009 at 17:51, Malcolm Tredinnick <malc...@pointy-stick.com>wrote: > > On Tue, 2009-03-31 at 16:50 -0600, Marcos Marín wrote: > > I have overridden the user change form, I only want to have the email > > field however the username field seems to always appear no matter

overriding the UserChangeForm

2009-03-31 Thread Marcos Marín
I have overridden the user change form, I only want to have the email field however the username field seems to always appear no matter what. Is this a bug or by design? I'm using the beta. class EstudianteForm(UserChangeForm): class Meta(UserChangeForm.Meta): fields = (

Re: Conditional Inline in admin interface

2009-03-26 Thread Marcos Marin
ubject: Re: Conditional Inline in admin interface On Thu, Mar 26, 2009 at 11:11 AM, Marcos Marin <marcosma...@gmail.com> wrote: I have an app with three different kinds of users (staff, students and professors) and each of these have a unique profile model. I was recommended to u

Conditional Inline in admin interface

2009-03-26 Thread Marcos Marin
I have an app with three different kinds of users (staff, students and professors) and each of these have a unique profile model. I was recommended to use a proxy class to override get_profile() so that it will return the correct profile depending on the user's group and this seems to work. My

Re: Django form: Allow user to insert a date in dd-mm-yyyy format and then convert in yyyy-mm-dd

2009-03-18 Thread MarcoS
the form with the follow field: date = forms.DateField(widget=DateTextInput(format='d/m/y'), input_formats=['%d/%m/%y']) It's correct? On 18 Mar, 13:45, Adi Sieker <a...@sieker.info> wrote: > Hi, > > On 18.03.2009, at 13:01, MarcoS wrote: > > > > > Hi Adi, thanks for your

Re: Django form: Allow user to insert a date in dd-mm-yyyy format and then convert in yyyy-mm-dd

2009-03-18 Thread MarcoS
/contrib/admin/media/js/admin/DateTimeShortcuts.js line 239)... On Mar 18, 11:53 am, Adi Sieker <a...@sieker.info> wrote: > Hi, > > On 18.03.2009, at 11:43, MarcoS wrote: > > > > > Hi all, > > I'm implementing a form in django with a DateField field in forms.p

Django form: Allow user to insert a date in dd-mm-yyyy format and then convert in yyyy-mm-dd

2009-03-18 Thread MarcoS
Hi all, I'm implementing a form in django with a DateField field in forms.py. My purpose is to allow a user to insert a date in european format (dd/ mm/) and then, obviously, convert it in the /mm/dd format to let's django check if it's a valid date and save it in a db. currently I've a

Re: Forms: custom clean for DateField

2009-03-06 Thread MarcoS
Sorry, i've posted without finishing the message :) So, if I call clean(self), Django give me this exception for the following line: super(forms.DateField, self).clean() Exception Type: TypeError Exception Value: super(type, obj): obj must be an instance or subtype of type

Re: populate a form from database and show all item fields in a template

2009-03-01 Thread MarcoS
I solved it! I was getting drowning in my own spittle! This is the code in forms.py class BookForm(forms.Form): def __init__(self, *args, **kwargs): super(BookForm, self).__init__(*args, **kwargs) books = Book.objects.all() for item in books: field =

Re: populate a form from database and show all item fields in a template

2009-02-28 Thread MarcoS
> It sounds like you're looking for a modelform. I don't think I need modelform 'cause my purpose it's only show books items details with a checkbox for each one. I need to obtain html like this: Book title: "Harry Potter and the Philosopher's Stone" price: "25.00" Book title:

Re: populate a form from database and show all item fields in a template

2009-02-27 Thread MarcoS
> Try using a multiplemodelchoice field with a checkboxselectmultiple widget. > > Alex Ok thanks, I've changed forms.py like this: -- forms.py -- class BookForm(forms.Form): book_item = forms.ModelMultipleChoiceField (queryset=Book.objects.all(), widget=forms.CheckboxSelectMultiple)

populate a form from database and show all item fields in a template

2009-02-27 Thread MarcoS
Hi! wondering if someone could point me in the right direction with this one: I'm trying to populate fields in a form with data from database: i.e. suppose I've this model: -- models.py -- class Book(models.Model): title = models.CharField(max_length=100) pages = models.IntegerField()

Re: Models and access to one-to-many

2006-01-14 Thread Marcos Sánchez Provencio
That smells too much of premature optimisation ;-) If you know your model slightly, you know when a database hit happens (and it might be unavoidable anyway, so why worry?). El sáb, 14-01-2006 a las 13:51 +, Luke Plant escribió: > One reason for the way it is at the moment is it's easy to

Re: Upgrading models...

2005-12-27 Thread Marcos Sánchez Provencio
at way. > > > -- > "May the forces of evil become confused on the way to your house." > -- George Carlin -- Marcos Sánchez Provencio <[EMAIL PROTECTED]>

Re: single table inheritance

2005-12-21 Thread Marcos Sánchez Provencio
- which is, in fact, abstract in C++ sense, I'm > only going to use Composer/Conductor/Soloist. The SQL generator > appears broken for the order of the derived classes, or I'm not > supposed to do such things in a model? > > Rails has "single table inheritance" in the sense you can put all > attributes into one table, and superimpose all classes on it, with an > extra "type" column as the discriminant/class tag. Any such thing in > django? > -- Marcos Sánchez Provencio <[EMAIL PROTECTED]>

Re: Problems with mod_python

2005-12-14 Thread Marcos Sánchez Provencio
You might try the mod_python list... ¿What does the apache error log say? El vie, 02-12-2005 a las 21:56 -0800, [EMAIL PROTECTED] escribió: > I hava Windows, apache 2.0.55 python 2.4.2 and mod python 3.2.5b > installed. > > I have add to httpd.conf LoadModule for mod_pythone. > > But apache

Re: unable to open /usr/lib/python2.4/config/Makefile (No such file or directory)

2005-12-10 Thread marcos sánchez provencio
¿Did you google that? install python2.4-dev peter ma wrote: OS is debian SID error: invalid Python installation: unable to open /usr/lib/python2.4/config/Makefile (No such file or directory)

[OT] Article on showing selected item by using css

2005-12-10 Thread marcos sánchez provencio
This has been discussed in this list lately; I Hope the OT does not offend anyone. http://24ways.org/advent/auto-selecting-navigation

Re: preexisting database

2005-12-08 Thread marcos sánchez provencio
http://www.djangoproject.com/documentation/legacy_databases/ patrick k wrote: is there any documentation on how to work with a pre-existing database? patrick

Re: django-admin not seeing settings.py

2005-11-07 Thread Marcos Sánchez Provencio
ntered this situation once, because of the admin manage changes. > You should delete all django source code, and recheckout the code from > svn. > > -- > I like python! > My Blog: http://www.donews.net/limodou > NewEdit Maillist: http://groups.google.com/group/NewEdit -- Marcos Sánchez Provencio <[EMAIL PROTECTED]>

Re: init ignoring 127.0.0.1

2005-11-02 Thread Marcos Sánchez Provencio
n which it is running and not on > 127.0.0.1. I am doing this on the latest svn of django - previously i > had done this on svn #6xx. Any clues? -- Marcos Sánchez Provencio <[EMAIL PROTECTED]>