Re: Django-Channels with 2 applications

2019-11-04 Thread Daniel Carvalho
às 13:47:55 UTC, Integr@te System escreveu: > > Hi Idea man, > > You can acknowlegdes and try it: > > https://channels.readthedocs.io/en/latest/ > > > On Mon, Nov 4, 2019, 19:11 Daniel Carvalho > wrote: > >> Hello! >> >> >> I'm tryi

Django-Channels with 2 applications

2019-11-04 Thread Daniel Carvalho
Hello! I'm trying to make an example to test if it is possible to have 2 independent django apps connected to the same channel from django-channels. So far, I was able to make an example running on one machine and 2 other machines being able to access the first via a client. But the goal is

Re: how to raise an error on django admin

2011-01-04 Thread Daniel Carvalho
I think the way to do is: from django.contrib import messages then somewhere... messages.add_message(request, messages.ERROR, "your error message") The message will be displayed in the top of the next admin page On 01/03/2011 09:40 PM, Acorn wrote: > I'd like to know this too. > > On 3

Re: removable file field and other features

2011-01-02 Thread Daniel Carvalho
On 12/20/2010 12:55 AM, Daniel Carvalho wrote: > Everybody knows the default django FileField doesn't allow to remove an > existing file... > > This is a good replacement. Just use RemovableFileField instead of > FileField in your models: > http://djangosnippets.org/snippets/6

removable file field and other features

2010-12-19 Thread Daniel Carvalho
Everybody knows the default django FileField doesn't allow to remove an existing file... This is a good replacement. Just use RemovableFileField instead of FileField in your models: http://djangosnippets.org/snippets/636/ I want to implement on it another feature- When there is a file being

form upload field and form validation

2010-12-13 Thread Daniel Carvalho
hi I have a form with a file upload field. If the form fails validation, the user has to give all the file fields another time. Someone told me it is possible to avoid that but I can't find more information... There was a thread about this before:

Re: doing validation in admin form

2010-12-07 Thread Daniel Carvalho
On 12/06/2010 04:18 PM, Wayne Smith wrote: > Then yes, in the clean() method of your Galeria form, you could check the > number of fotos present and then raise a ValidationError if it is too many, > along with a custom message for the user. > > Is that what you wish to do? > hi I think the

Re: doing validation in admin form

2010-12-06 Thread Daniel Carvalho
On 12/06/2010 03:05 AM, Wayne Smith wrote: > It's hard to say, because I don't know what kind of "validation" or business > logic regarding it you are trying to accomplish/employ. > suppose I want a validation like this: the number of fotos in a galeria should be limited to a number, which

doing validation in admin form

2010-12-05 Thread Daniel Carvalho
hi I have this models: models.py: class Galeria(models.Model): ... class Foto(models.Model): ... galeria = models.ForeignKey(Galeria, null=False) admin.py: class FotoInline(admin.StackedInline): model = Foto class GaleriaAdmin(admin.ModelAdmin): inlines = [FotoInline,

list_display with a function

2010-12-01 Thread Daniel Carvalho
hi I have a model that defines a function: class Test(models.Model): name = models.CharField(max_length=200) data_expira = models.DateField() def expired(self): return self.data_expira < datetime.date.today() expired.short_description = 'Expirou?' I want to put it in

no such class TextArea

2010-11-22 Thread Daniel Carvalho
Hi, I want to define a form with a multi-line textfield. from django import forms class TesteForm(forms.Form): field1 = forms.CharField( max_length=100,widget=forms.widgets.TextInput()) ... field2 = forms.CharField( widget=forms.widgets.TextArea(attrs={'cols':

arbitrary ordering in a model

2010-11-18 Thread Daniel Carvalho
Hi I have some models where I want objects to be displayed in an arbitrary order. For that I have in the model a number field, which is used to sort. class MyModel: ... class Meta: ordering = ["orderfield"] It would be cool if instead of editing this field, I have a "go up" and "go down"