register for mIRC

2014-03-29 Thread CS
Hi everyone,

I am new at python and I want to start to learn django.
I have small question, how can I register my ID to join #django in mIRC?

CS

-- 
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 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/677c008b-7bfb-46cb-8185-4142f0883728%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Separating models from proxies conflicts

2012-09-13 Thread cs


Am Montag, 20. August 2012 15:52:28 UTC+2 schrieb Nacho Mas:
>
> I'm trying to separate my models from my proxies in order to maintain the 
> functionality more easily. The point is that, as my models.py started to 
> grow over and over, I decided to create a new file in each app (proxies.py) 
> where I'd define my proxies. I used to work like this:
>
> # models.py
>
> class MyModel(models.Model):
> prop1 = ...
> prop2 = ...
>
> def f1(self):
> pass
> def f2(self):
> pass
>
>
> However, I wanted to have this structure:
>
> # models.py
>
> class MyModel(models.Model):
> prop1 = ...
> prop2 = ...
>
> # proxies.py
>
> from myapp import models
>
>
> class MyModel(models.MyModel):
>
> def f1(self):
> pass
> def f2(self):
> pass
>
> class Meta:
> proxy = True
>
> But, when I tried to make some tests:
>
> $ python manage.py shell
> Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> (InteractiveConsole)
> >>> from myapp.proxies import MyModel
> >>> MyModel
> 
>
> So, when I ask for the proxy it gives me the model in models.py. And, of 
> course, it keeps the properties defined on the model but lacks all of the 
> methods in the proxy. Could anybody please tell me WTF is going on here?
>
> Thanks for your help :)
>
>
you probably want this:

# models.py

class MyModelBase(models.Model):
prop1 = ...
prop2 = ...

# proxies.py

from myapp import models


class MyModel(models.MyModelBase):

def f1(self):
pass
def f2(self):
pass

class Meta:
proxy = True

$ python manage.py shell

from myapp.proxies import MyModel
m = MyModel()
m.f1()
m.f2()

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FEWjAUEUPVIJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Potential Bug with hidden_intial_fields

2012-09-13 Thread cs
Hello,

while working on a mechanism for optimistic offline locking for django 
modelforms we discovered the following issue:


After a failed form validation this forms hidden_initial-fields (rendered 
via the field argument show_hidden_initial=True) will be rendered 
containing the submitted data of the corresponding regular fields not the 
data the hidden_initial_fields have submitted 
This might cause confusion because: if the form was not saved the value was 
not saved in the database but is now considered as current db-state in the 
hidden_initial_field
in addition if a succesive submit is triggered the form will now not 
identify a form.has_changed-event for the corresponding field


IMHO the hidden_initial_field should recieve its POST/GET data from the 
hidden_initial_field-data instead of the POST/GET data from the original 
field after a submit

The question is: Is this considered as a bug or is it just some feature not 
used the desired way

any comment on this are welcome

cs



A simplified way to reproduce this: 

-field ('label') has the argument show_hidden_initial=True
-open the view with an instance from the database
-change the value of the label field and save -> form will be declared 
invalid and form.label_initial will contain the new value despite that the 
form could not be saved
-in addition if save is clicked again the form is valid and 
form.changed_data will be empty


class MyModel(models.Model)
label = models.CharField()


class MyModelForm(forms.Form)
def __init__(*args, **kwargs):
super(MyModelForm, self).__init__(*args, **kwargs)
for f in self.fields.keys():
self.fields[f].show_hidden_initial = True

class Meta:
model = MyModel

  def clean(self):
cleaned_data = super(MyModelForm, self).clean()

if self.changed_data:
self._errors['label'] = ErrorList(['form has changed'])

return cleaned_data


def myView(request, modelId=None):

if modelId:
instance = MyModel.objects.get(pk=modelId)
else:
instance = None

if request.method == 'POST':
form = MyModelForm(request.POST, instance=instance)

if form.is_valid():
instance = form.save()
return HttpResponse('Success')
else:
form = MyModelForm(instance=instance)

template = '''{{form}}'''

t = template.Template(output)
c = template.Context({'form':form})
return t.render(c) 




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/Umu0mUELRvsJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Senior Python/Django

2009-07-07 Thread eric cs

We are looking for experienced Django / Python, patrones de diseño,
UML, CSS, Ajax, Mysql desarrolladores para un trabajo de tiempo
completo.
Por favor enviar su CV con aspiraciones salariales.
projetoec...@hotmail.com

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



phone

2007-05-28 Thread cs

look it
_
使用下一代的 MSN Messenger。
http://imagine-msn.com/messenger/launch80/default.aspx?locale=zh-cn=wlmailtagline
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---

<>