Russ,
Here is my Orders Class:

class Orders(models.Model):
    timestamp = models.DateField()
    b_name = models.CharField("Billing Name", maxlength=100)
    b_address = models.CharField("Billing Address", maxlength=100)
    b_city = models.CharField("Billing City", maxlength=100)
    b_state = models.USStateField("Billing State")
    b_zip = models.CharField("Billing Zip", maxlength=100)
    b_phone = models.CharField("Billing Phone", maxlength=100)
    b_email = models.EmailField("Billing Email")
    s_name = models.CharField("Name", maxlength=100)
    s_address = models.CharField("Shipping Address", maxlength=100)
    s_city = models.CharField("Shipping City", maxlength=100)
    s_state = models.USStateField("Shipping State")
    s_zip = models.CharField("Shipping Zip", maxlength=100)
    s_phone = models.CharField("Shipping Phone", maxlength=100)
    s_email = models.EmailField("Shipping Email")
    amount = models.CharField("Order Amount", maxlength=100)
    card_number = models.CharField("Card Number", maxlength=100)
    exp_date = models.CharField("Exp. Date", maxlength=100)
    card_code = models.CharField("Card Code", maxlength=100)
    order_status = models.ForeignKey(OrderStatus)
    voided = models.BooleanField("Has order been voided?")
    email = models.BooleanField("Has an email been sent")
    order = models.TextField("Details of Order", maxlength=1000)
    comments = models.TextField("none", maxlength=1000)

    class Admin:
        list_display = ('s_name', 'order_status')

    def __str__(self,):
        return self.s_name

On Jul 29, 11:59 pm, Greg <[EMAIL PROTECTED]> wrote:
> Russ,
> Here is my traceback:
>
> Traceback (most recent call last):
> File "c:\Python24\lib\site-packages\django\core\handlers\base.py" in
> get_response
>   77. response = callback(request, *callback_args, **callback_kwargs)
> File "c:\Python24\lib\site-packages\django\contrib\admin\views
> \decorators.py" in _checklogin
>   55. return view_func(request, *args, **kwargs)
> File "c:\Python24\lib\site-packages\django\views\decorators\cache.py"
> in _wrapped_view_func
>   39. response = view_func(request, *args, **kwargs)
> File "c:\Python24\lib\site-packages\django\contrib\admin\views
> \main.py" in change_stage
>   370. new_data = manipulator.flatten_data()
> File "c:\Python24\lib\site-packages\django\db\models\manipulators.py"
> in flatten_data
>   250. new_data.update(f.flatten_data(fol, obj))
> File "c:\Python24\lib\site-packages\django\db\models\fields
> \__init__.py" in flatten_data
>   514. return {self.attname: (val is not None and val.strftime("%Y-%m-
> %d") or '')}
>
>   AttributeError at /admin/rugs/orders/1/
>   'unicode' object has no attribute 'strftime'
>
> On Jul 29, 11:34 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
> wrote:
>
> > On 7/30/07, Greg <[EMAIL PROTECTED]> wrote:
>
> > > Russ,
> > > I tried including the code that you recommended.  However, I'm still
> > > getting the same error:
>
> > > AttributeError at /admin/rugs/orders/1/
> > > 'unicode' object has no attribute 'strftime'
>
> > Just to clarify - If you create, modify and save an object at the
> > command prompt, it works fine. You can retrieve the object using the
> > command line using calls to filter, etc, and print out objects
> > retrieved (e.g., print Order.objects.get(pk=1) ). However, when you
> > view the object in the admin pages you get an error. Is this correct?
>
> > If this is the case, it is possible that you have encountered some
> > sort of bug with the admin views dealing with date fields; to help
> > track this down, could you provide:
>
> > - A full stack trace of the error you are seeing
> > - The exact revision of Django you are using
> > - The code for the Order model
> > - The database backend you are using
>
> > Thanks,
> > Russ Magee %-)


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

Reply via email to