Re: Django, Dojo and JSON-RPC

2009-04-06 Thread Rob Goedman
Jani,

Not sure what you are trying to achieve. Wolfram suggested below  
solution to me a while ago and I'm happy with it.

Rob

On Apr 6, 2009, at 3:14 AM, Jani Tiainen wrote:

>
> I've been trying to find out nice solution to handle JSON-RPC with
> Django and Dojo (Dojango).
>
> So far not much avail. Has anyone succeeded with this? Care to share
> what kind of packages do I need to make it working with preferably
> automated SMD generations.
>
> -- 
> Jani Tiainen
>
> >


>
> On Nov 2, 2008, at 12:42 AM, Wolfram Kriesing wrote:
>
>>
>> awesome :-)
>> Glad I could help.
>> Feel free to ask anything, I will try to help!
>>
>> -- 
>> cu
>>
>> Wolfram
>>
>> http://uxebu.com - web consultancy
>> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!
>>
>>
>>
>> On Sun, Nov 2, 2008 at 1:14 AM, Rob Goedman <goed...@mac.com> wrote:
>>>
>>> Wolfram,
>>>
>>> You bet I've read your blogs! Wouldn't have gotten where I got to
>>> without them!
>>>
>>> Clearly I had missed the to_dojo_data(), that's exactly what I was
>>> looking for.
>>>
>>> This works super.
>>>
>>> Thanks a lot,
>>> Rob
>>>
>>> On Nov 1, 2008, at 4:45 PM, Wolfram Kriesing wrote:
>>>
>>>>
>>>> Hi Rob,
>>>>
>>>> aehm, maybe what you were looking for was this:
>>>>
>>>> @json_response
>>>> def send_toxids_list(request):
>>>>   ret = Toxid.objects.all()
>>>>   return to_dojo_data(ret, identifier='docno')
>>>>
>>>> the json_response decorator takes care of extrcting only the
>>>> fields form the model, you dont have to do this
>>>> by hand. And the to_dojo_data() function converts the
>>>> data into a dojo.data store compatible format.
>>>>
>>>> See also this blog post about more info
>>>> about the json_response decorator/function
>>>> and insight details.
>>>> http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django
>>>>
>>>>
>>>> --
>>>> cu
>>>>
>>>> Wolfram
>>>>
>>>> http://uxebu.com - the AJAX experts
>>>> You need AJAX, RIA, JavaScript and all this modern stuff? We got  
>>>> it!
>>>
>>>
>>>> On Nov 1, 2008, at 4:34 PM, Wolfram Kriesing wrote:
>>>>>
>>>>> Hi Rob,
>>>>>
>>>>> did you see the blog article
>>>>> http://blog.uxebu.com/2008/07/26/ajax-with-dojango/
>>>>> and the examples in
>>>>> http://code.google.com/p/dojango/source/browse/trunk/dojango/views.py
>>>>>
>>>>> tbh I don't really understand what you are using the JSON
>>>>> serializer for.
>>>>> Could you may be explain, if the links above dont help?
>>>>>
>>>>> --
>>>>> cu
>>>>>
>>>>> Wolfram
>>>>>
>>>>> http://uxebu.com - the AJAX experts
>>>>> You need AJAX, RIA, JavaScript and all this modern stuff? We got  
>>>>> it!
>>>
>>>
>>>>> On Sat, Nov 1, 2008 at 11:31 PM, Rob Goedman <goed...@mac.com>  
>>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Just for Django & Dojo users.
>>>>>
>>>>> Working through the 'Mastering Dojo' book, updating the examples
>>>>> where
>>>>> applicable to Dojo 1.2 (i.e. grids) and making them work with  
>>>>> Django
>>>>> svn has gone pretty smoothly. I wonder if below method is a
>>>>> reasonable
>>>>> way to generate fairly generic xhr* responses?
>>>>>
>>>>> I use something like (e.g. from the dojo.data chapter on
>>>>> QueryReadStore):
>>>>>
>>>>> @json_response
>>>>> def send_toxids_list(request):
>>>>>  """
>>>>>  Creates a JSON/Dojo hash with the filtered contents
>>>>>  for a grid. This method is called by Dojo xhr*.
>>>>>
>>>>>  To do:
>>>>>
>>>>>  1)  Change ...all() into ...filter()
>>>>

Re: How do i use dojo in my Django application

2009-04-02 Thread Rob Goedman
Gath,

Attached at the end of this email an exchange from a few months back  
about Dojo & Django using the dojango application.

I've been using this and have been happy with it.

http://code.google.com/p/dojango/

Rob


On Apr 2, 2009, at 7:55 AM, Dougal Matthews wrote:

> It kinds depends what you want to do really.
>
> JavaScript is run inside the browser and Django is running on your  
> website. So it doesn't even know what Django or Python is, however  
> they can communicate and pass data.
>
> By using it with Django, do you mean you want to do some Ajax stuff?  
> If that's the case then you will want to decide how you are going to  
> pass data. You can then just make your views return the appropriate  
> data, be that chunks of HTML, JSON or XML etc.
>
> Dougal
>
> ---
> Dougal Matthews - @d0ugal
> http://www.dougalmatthews.com/
>
>
>
> 2009/4/2 Gath <pgath...@gmail.com>
>
> All,
>
> I have downloaded Dojo 1.3, i want to start sampling some examples  in
> the Dojo website using Django, where do i place the package? How do i
> call it in my template?
>
> Gath
>
>
>
> >



On Nov 2, 2008, at 12:42 AM, Wolfram Kriesing wrote:

>
> awesome :-)
> Glad I could help.
> Feel free to ask anything, I will try to help!
>
> -- 
> cu
>
> Wolfram
>
> http://uxebu.com - web consultancy
> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!
>
>
>
> On Sun, Nov 2, 2008 at 1:14 AM, Rob Goedman <goed...@mac.com> wrote:
>>
>> Wolfram,
>>
>> You bet I've read your blogs! Wouldn't have gotten where I got to
>> without them!
>>
>> Clearly I had missed the to_dojo_data(), that's exactly what I was
>> looking for.
>>
>> This works super.
>>
>> Thanks a lot,
>> Rob
>>
>> On Nov 1, 2008, at 4:45 PM, Wolfram Kriesing wrote:
>>
>>>
>>> Hi Rob,
>>>
>>> aehm, maybe what you were looking for was this:
>>>
>>> @json_response
>>> def send_toxids_list(request):
>>>   ret = Toxid.objects.all()
>>>   return to_dojo_data(ret, identifier='docno')
>>>
>>> the json_response decorator takes care of extrcting only the
>>> fields form the model, you dont have to do this
>>> by hand. And the to_dojo_data() function converts the
>>> data into a dojo.data store compatible format.
>>>
>>> See also this blog post about more info
>>> about the json_response decorator/function
>>> and insight details.
>>> http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django
>>>
>>>
>>> --
>>> cu
>>>
>>> Wolfram
>>>
>>> http://uxebu.com - the AJAX experts
>>> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!
>>
>>
>>> On Nov 1, 2008, at 4:34 PM, Wolfram Kriesing wrote:
>>>>
>>>> Hi Rob,
>>>>
>>>> did you see the blog article
>>>> http://blog.uxebu.com/2008/07/26/ajax-with-dojango/
>>>> and the examples in
>>>> http://code.google.com/p/dojango/source/browse/trunk/dojango/views.py
>>>>
>>>> tbh I don't really understand what you are using the JSON
>>>> serializer for.
>>>> Could you may be explain, if the links above dont help?
>>>>
>>>> --
>>>> cu
>>>>
>>>> Wolfram
>>>>
>>>> http://uxebu.com - the AJAX experts
>>>> You need AJAX, RIA, JavaScript and all this modern stuff? We got  
>>>> it!
>>
>>
>>>> On Sat, Nov 1, 2008 at 11:31 PM, Rob Goedman <goed...@mac.com>  
>>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> Just for Django & Dojo users.
>>>>
>>>> Working through the 'Mastering Dojo' book, updating the examples
>>>> where
>>>> applicable to Dojo 1.2 (i.e. grids) and making them work with  
>>>> Django
>>>> svn has gone pretty smoothly. I wonder if below method is a
>>>> reasonable
>>>> way to generate fairly generic xhr* responses?
>>>>
>>>> I use something like (e.g. from the dojo.data chapter on
>>>> QueryReadStore):
>>>>
>>>> @json_response
>>>> def send_toxids_list(request):
>>>>  """
>>>>  Creates a JSON/Dojo hash with the filtered contents
>>>> 

Re: Dojango question

2008-11-01 Thread Rob Goedman

Wolfram,

You bet I've read your blogs! Wouldn't have gotten where I got to  
without them!

Clearly I had missed the to_dojo_data(), that's exactly what I was  
looking for.

This works super.

Thanks a lot,
Rob

On Nov 1, 2008, at 4:45 PM, Wolfram Kriesing wrote:

>
> Hi Rob,
>
> aehm, maybe what you were looking for was this:
>
> @json_response
> def send_toxids_list(request):
>ret = Toxid.objects.all()
>return to_dojo_data(ret, identifier='docno')
>
> the json_response decorator takes care of extrcting only the
> fields form the model, you dont have to do this
> by hand. And the to_dojo_data() function converts the
> data into a dojo.data store compatible format.
>
> See also this blog post about more info
> about the json_response decorator/function
> and insight details.
> http://wolfram.kriesing.de/blog/index.php/2007/json-serialization-for-django
>
>
> -- 
> cu
>
> Wolfram
>
> http://uxebu.com - the AJAX experts
> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!


> On Nov 1, 2008, at 4:34 PM, Wolfram Kriesing wrote:
>>
>> Hi Rob,
>>
>> did you see the blog article
>> http://blog.uxebu.com/2008/07/26/ajax-with-dojango/
>> and the examples in
>> http://code.google.com/p/dojango/source/browse/trunk/dojango/views.py
>>
>> tbh I don't really understand what you are using the JSON  
>> serializer for.
>> Could you may be explain, if the links above dont help?
>>
>> -- 
>> cu
>>
>> Wolfram
>>
>> http://uxebu.com - the AJAX experts
>> You need AJAX, RIA, JavaScript and all this modern stuff? We got it!


>> On Sat, Nov 1, 2008 at 11:31 PM, Rob Goedman <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> Just for Django & Dojo users.
>>
>> Working through the 'Mastering Dojo' book, updating the examples  
>> where
>> applicable to Dojo 1.2 (i.e. grids) and making them work with Django
>> svn has gone pretty smoothly. I wonder if below method is a  
>> reasonable
>> way to generate fairly generic xhr* responses?
>>
>> I use something like (e.g. from the dojo.data chapter on
>> QueryReadStore):
>>
>> @json_response
>> def send_toxids_list(request):
>>   """
>>   Creates a JSON/Dojo hash with the filtered contents
>>   for a grid. This method is called by Dojo xhr*.
>>
>>   To do:
>>
>>   1)  Change ...all() into ...filter()  
>> according to qDict info.
>>
>>   """
>>
>>   qDict = request.GET
>>   print qDict['user'], qDict.get('query', None)
>>
>>   queryset = Toxid.objects.all()
>>   json_serializer = serializers.get_serializer("json")()
>>   toxids_json = json_serializer.serialize(queryset,  
>> ensure_ascii=True)
>>   t = eval(toxids_json)
>>   a = []
>>   for i in t: a.append(i['fields'])
>>   ret = {
>>   "identifier": "docno",
>>   "label": "substance",
>>   "items": a,
>>   }
>>   return ret
>>
>> It seems a frequently recurring pattern in my views, so I would like
>> to do it right and efficient. Particularly the 'eval' step feels  
>> weird.
>>
>> I did have a look at dojox.dtl (Django Templating Language) but
>> haven't (yet?) figured out if that is applicable for this.
>>
>> Thanks,
>> Rob
>>
>>
>>
>>>
>>
>
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Dojango question

2008-11-01 Thread Rob Goedman

Hi,

Just for Django & Dojo users.

Working through the 'Mastering Dojo' book, updating the examples where  
applicable to Dojo 1.2 (i.e. grids) and making them work with Django  
svn has gone pretty smoothly. I wonder if below method is a reasonable  
way to generate fairly generic xhr* responses?

I use something like (e.g. from the dojo.data chapter on  
QueryReadStore):

@json_response
def send_toxids_list(request):
"""
Creates a JSON/Dojo hash with the filtered contents
for a grid. This method is called by Dojo xhr*.

To do:

1)  Change ...all() into ...filter() according to 
qDict info.

"""

qDict = request.GET
print qDict['user'], qDict.get('query', None)

queryset = Toxid.objects.all()
json_serializer = serializers.get_serializer("json")()
toxids_json = json_serializer.serialize(queryset, ensure_ascii=True)
t = eval(toxids_json)
a = []
for i in t: a.append(i['fields'])
ret = {
"identifier": "docno",
"label": "substance",
"items": a,
}
return ret

It seems a frequently recurring pattern in my views, so I would like  
to do it right and efficient. Particularly the 'eval' step feels weird.

I did have a look at dojox.dtl (Django Templating Language) but  
haven't (yet?) figured out if that is applicable for this.

Thanks,
Rob



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: auto_add and auto_add_now in admin fieldsets

2008-10-18 Thread Rob Goedman

Thank you James!

That is actually cool behavior as they do show up on the list page and  
are indeed not needed on the detail page.

Should your note below be added to 
http://docs.djangoproject.com/en/dev/ref/models/fields/#datefield 
  ?

Thanks again,
Rob



On Oct 18, 2008, at 11:27 AM, James Bennett wrote:

>
> On Sat, Oct 18, 2008 at 12:20 PM, Rob Goedman <[EMAIL PROTECTED]> wrote:
>> I couldn't find this in the ticket list. Has anybody else  
>> encountered/
>> tried this?
>
> This is really sort of intended behavior; auto_now and auto_now_add on
> a model field implicitly set "editable=False", which means it's not
> meant to ever be shown in a form (since user input will always be
> disregarded in favor of the automatic value). As a result, things like
> ModelForm and the admin which automatically generate forms for you
> will refuse to include these fields (since they skip any field with
> editable=False), which is most likely what's causing your problem.
>
> The answer is not to try to display a form field for something which
> has auto_now=True or auto_now_add=True.
>
>
> -- 
> "Bureaucrat Conrad, you are technically correct -- the best kind of  
> correct."
>
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



auto_add and auto_add_now in admin fieldsets

2008-10-18 Thread Rob Goedman

Hi,

With below example, using the 1.1 pre-alpha SVN-6477 version:


class Entity(models.Model):
...
name = ...
created_on = models.DateTimeField(auto_now_add=True)
created_by = ...
...

and


class EntityAdmin(admin.ModelAdmin):
fieldsets = [
(None,
{'fields': ['name']}),
('Create information',
{'fields': ['created_by', 'created_on'], 'classes': 
['collapse']}),
]
list_display = ('name', 'created_on', 'created_by')


On using the admin it will complain "'created_on' is missing from the  
form" on the entity change form. It correctly shows 'created_on' on  
the entity list page. The same with e.g. pub_date in the Poll tutorial  
example.

Replacing the 'auto_add_now=True' by 'default=datetime.datetime.now'  
in the model does work.

I couldn't find this in the ticket list. Has anybody else encountered/ 
tried this?

Thanks,
Rob



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Re: Can't add more than 2 items in stacked/tabular inlines using tutorial part 2

2008-10-03 Thread Rob Goedman
Hi Karen,

Right on, thank you. The patch provided in the ticket fixes the  
problem. I do use PostgreSQL.
I should have checked the ticket list!

Thanks again,
Rob


On Oct 3, 2008, at 9:57 AM, Karen Tracey wrote:

> On Fri, Oct 3, 2008 at 12:43 PM, Rob Goedman <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Using Django svn rev 9111 I ran into an issue using the admin. To
> create a reproducible example I went back to the Django Poll/Choice
> tutorial, part 2.
>
> With below models.py and admin.py, I can create a new Poll, add the
> 1st choice and save, add the 2nd and save, but that's it. After that
> it will just show the 'Please correct the errors below' validation
> message.
>
> I can add more (3rd, 4th) choices using the Ipython shell. Database is
> Postgres.
>
> Any hints?  My next step would be to override the models 'save'
> methods to further investigate. Django search does not show any hits
> on this problem.
>
>
> Are you using  PostgreSQL?  You might be hitting:
>
> http://code.djangoproject.com/ticket/9076
>
> Karen
>
>
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Can't add more than 2 items in stacked/tabular inlines using tutorial part 2

2008-10-03 Thread Rob Goedman
Hi,

Using Django svn rev 9111 I ran into an issue using the admin. To  
create a reproducible example I went back to the Django Poll/Choice  
tutorial, part 2.

With below models.py and admin.py, I can create a new Poll, add the  
1st choice and save, add the 2nd and save, but that's it. After that  
it will just show the 'Please correct the errors below' validation  
message.

I can add more (3rd, 4th) choices using the Ipython shell. Database is  
Postgres.

Any hints?  My next step would be to override the models 'save'  
methods to further investigate. Django search does not show any hits  
on this problem.

Thanks,
Rob



--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---

from d3.polls.models import Poll, Choice
from django.contrib import admin

class ChoiceInline(admin.TabularInline):
	model = Choice
	extra = 1

class PollAdmin(admin.ModelAdmin):
	"""docstring for PollAdmin(admin.ModelAdmin)"""
	fieldsets = [
		(None,	{'fields': ['question']}),
		('Date information',	{'fields': ['pub_date'], 'classes': ['collapse']})
	]
	inlines = [ChoiceInline]
	list_display = ('question', 'pub_date', 'was_published_today')
	list_filter = ['pub_date']
	search_fields = ['question']
	date_hierarchy = 'pub_date'
		
admin.site.register(Poll, PollAdmin)





from django.db import models
import datetime

# Create your models here.


class Poll(models.Model):
	question = models.CharField(max_length=200)
	pub_date = models.DateTimeField('date published', default=datetime.datetime.now)
	
	def __unicode__(self):
		"""docstring for unicode"""
		return self.question
	
	def was_published_today(self):
		"""docstring for was_published_today"""
		return self.pub_date.date() == datetime.date.today()
	was_published_today.short_description = 'Published today?'


class Choice(models.Model):
	"""docstring for Choice"""
	poll = models.ForeignKey(Poll)
	choice = models.CharField(max_length=200)
	votes = models.IntegerField()
	
	def __unicode__(self):
		"""docstring for unicode"""
		return self.choice





Re: Core keyword error

2008-08-28 Thread Rob Goedman

Thanks Malcolm and Rajesh!

Expected I had missed something. Should have noted that 1st line
Googling 'django core arguments' instead of 'django core keyword' got  
me there.

Thanks again,
Rob


On Aug 28, 2008, at 12:30 PM, Malcolm Tredinnick wrote:

> On Thu, 2008-08-28 at 12:24 -0700, Rob Goedman wrote:
> [..]
>> Until beta-1 no problems. Any hints?
>
> It was removed as part of r8616. It hasn't actually been needed since
> newforms-admin landed, but was tied to the manipulator code that was
> removed in the above changeset.
>
> Regards,
> Malcolm


On Aug 28, 2008, at 12:35 PM, Rajesh Dhawan wrote:

>
> Hi Rob,
>
> On Aug 28, 3:24 pm, Rob Goedman <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> Since moving to beta-2 I get:
>>
>> Robs-Intel:mcp rob$ ./manage.py runserver
>> Validating models...
>> Unhandled exception in thread started by > 0x7a8470>
>> Traceback (most recent call last):
>>File "/Library/Python/2.5/site-packages/django/core/management/
>> commands/runserver.py", line 47, in inner_run
>>  self.validate(display_num_errors=True)
>>File "/Library/Python/2.5/site-packages/django/core/management/
>> base.py", line 122, in validate
>>  num_errors = get_validation_errors(s, app)
>>File "/Library/Python/2.5/site-packages/django/core/management/
>> validation.py", line 28, in get_validation_errors
>>  for (app_name, error) in get_app_errors().items():
>>File "/Library/Python/2.5/site-packages/django/db/models/
>> loading.py", line 128, in get_app_errors
>>  self._populate()
>>File "/Library/Python/2.5/site-packages/django/db/models/
>> loading.py", line 57, in _populate
>>  self.load_app(app_name, True)
>>File "/Library/Python/2.5/site-packages/django/db/models/
>> loading.py", line 72, in load_app
>>  mod = __import__(app_name, {}, {}, ['models'])
>>File "./Descriptors/models.py", line 27, in 
>>  class AEDescriptor(models.Model):
>>File "./Descriptors/models.py", line 31, in AEDescriptor
>>  code = models.PositiveSmallIntegerField(core=True)
>> TypeError: __init__() got an unexpected keyword argument 'core'
>>
>> It's the 1st app that contains core=True in models.py:
>>
>> class AEDescriptor(models.Model):
>> """ The Descriptor class for alarm/event/system message  
>> descriptor
>> instances.
>> Table is loaded from ./mcp/Descriptors/sql/ 
>> descriptor.sql"""
>>
>> code = models.PositiveSmallIntegerField(core=True)
>> descriptor = models.CharField(max_length=60, core=True)
>>
>> def __str__(self):
>> return self.descriptor
>>
>> class Meta:
>> verbose_name_plural = 'Alarms and events descriptors'
>> db_table='alarm_and_event_descriptors'
>>
>> Until beta-1 no problems. Any hints?
>>
>> I've checked the incompatible backward changes page and searched the
>> archives but was not able to find anything.
>
> Actually, it's kind of included in this entry:
> http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges#Removedoldformsvalidatorsandrelatedcode
>
> But you're right that it doesn't explicitly spell out that you will
> need to remove the core option from all your model fields for model
> validation to succeed.
>
>> I continue to be impressed by how smooth the migration/tracking svn
>> has been using that page!
>
> Yep.
>
> -Rajesh D
> >


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Core keyword error

2008-08-28 Thread Rob Goedman

Hi,

Since moving to beta-2 I get:

Robs-Intel:mcp rob$ ./manage.py runserver
Validating models...
Unhandled exception in thread started by 
Traceback (most recent call last):
   File "/Library/Python/2.5/site-packages/django/core/management/ 
commands/runserver.py", line 47, in inner_run
 self.validate(display_num_errors=True)
   File "/Library/Python/2.5/site-packages/django/core/management/ 
base.py", line 122, in validate
 num_errors = get_validation_errors(s, app)
   File "/Library/Python/2.5/site-packages/django/core/management/ 
validation.py", line 28, in get_validation_errors
 for (app_name, error) in get_app_errors().items():
   File "/Library/Python/2.5/site-packages/django/db/models/ 
loading.py", line 128, in get_app_errors
 self._populate()
   File "/Library/Python/2.5/site-packages/django/db/models/ 
loading.py", line 57, in _populate
 self.load_app(app_name, True)
   File "/Library/Python/2.5/site-packages/django/db/models/ 
loading.py", line 72, in load_app
 mod = __import__(app_name, {}, {}, ['models'])
   File "./Descriptors/models.py", line 27, in 
 class AEDescriptor(models.Model):
   File "./Descriptors/models.py", line 31, in AEDescriptor
 code = models.PositiveSmallIntegerField(core=True)
TypeError: __init__() got an unexpected keyword argument 'core'


It's the 1st app that contains core=True in models.py:

class AEDescriptor(models.Model):
""" The Descriptor class for alarm/event/system message descriptor  
instances.
Table is loaded from ./mcp/Descriptors/sql/descriptor.sql"""

code = models.PositiveSmallIntegerField(core=True)
descriptor = models.CharField(max_length=60, core=True)

def __str__(self):
return self.descriptor

class Meta:
verbose_name_plural = 'Alarms and events descriptors'
db_table='alarm_and_event_descriptors'


Until beta-1 no problems. Any hints?

I've checked the incompatible backward changes page and searched the  
archives but was not able to find anything.
I continue to be impressed by how smooth the migration/tracking svn  
has been using that page!

Thanks,
Rob

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Newforms - error_messages

2007-11-30 Thread Rob Goedman

Hi,

Using newforms-admin, I'm using

request.user.message_set.create(message = _("User updated"))

quite a bit.

Is there an equivalent method to set the error note while processing  
save_change and save_add?

Thanks,
Rob

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---