Strange behaviour in for loop

Hi,
I have a table named pcharge in a Doctype Offer.

for row in offer.pcharge:

The above code gives me an error saying

for row in offer.pcharge:
 AttributeError: 'Offer' object has no attribute 'pcharge'

pcharge is table in doctype Offer. I havent been able to resolve this for a day now!

try using get?

for row in offer.get('pcharge')

correct syntax is:

 {%- for row in doc.pcharge -%}   //doc.<table name)
    {{ row.<row_field_name '' }}     // to print row detail, row.<row field name>
    {%- endfor -%}